Class ResourceSpec
java.lang.Object
io.strimzi.kafka.oauth.server.authorizer.ResourceSpec
ResourceSpec is used to parse a resource matching pattern and to perform matching to a specific resource.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a 'kafka-cluster' value (not the same as KafkaClusterresource type).Get resource nameGet a resource typebooleanSee if 'kafka-cluster' specification uses an asterisk as inkafka-cluster:*,Topic:ordersbooleanSee if a resource specification uses an asterisk as inTopic:orders_*booleanMatch specific resource's cluster, type and name to this ResourceSpec If clusterName is set then cluster must match, otherwise cluster match is ignored.static ResourceSpecA factory method to parse a ResourceSpec from a stringtoString()
-
Constructor Details
-
ResourceSpec
public ResourceSpec()
-
-
Method Details
-
getClusterName
Get a 'kafka-cluster' value (not the same as KafkaClusterresource type). For example:kafka-cluster:my-cluster,Cluster:kafka-cluster- Returns:
- Cluster name
-
isClusterStartsWith
public boolean isClusterStartsWith()See if 'kafka-cluster' specification uses an asterisk as inkafka-cluster:*,Topic:orders- Returns:
- True if value ends with an asterisk
-
getResourceType
Get a resource type- Returns:
- ResourceType enum value
-
getResourceName
Get resource name- Returns:
- A resource name
-
isResourceStartsWith
public boolean isResourceStartsWith()See if a resource specification uses an asterisk as inTopic:orders_*- Returns:
- True if value ends with an asterisk
-
match
Match specific resource's cluster, type and name to this ResourceSpec If clusterName is set then cluster must match, otherwise cluster match is ignored. Type and name are always matched.- Parameters:
cluster- Kafka cluster name such as: my-kafkatype- Resource type such as: Topic, Groupname- Resource name such as: my-topic- Returns:
- true if cluster, type and name match this resource spec
-
of
A factory method to parse a ResourceSpec from a string- Parameters:
name- Resource spec as a string- Returns:
- A ResourceSpec instance
-
toString
-