Package org.apache.kafka.common.resource
Enum ResourceType
- java.lang.Object
-
- java.lang.Enum<ResourceType>
-
- org.apache.kafka.common.resource.ResourceType
-
- All Implemented Interfaces:
Serializable
,Comparable<ResourceType>
@Evolving public enum ResourceType extends Enum<ResourceType>
Represents a type of resource which an ACL can be applied to. The API for this class is still evolving and we may break compatibility in minor releases, if necessary.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANY
In a filter, matches any ResourceType.CLUSTER
The cluster as a whole.DELEGATION_TOKEN
A token ID.GROUP
A consumer group.TOPIC
A Kafka topic.TRANSACTIONAL_ID
A transactional ID.UNKNOWN
Represents any ResourceType which this client cannot understand, perhaps because this client is too old.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
code()
Return the code of this resource.static ResourceType
fromCode(byte code)
Return the ResourceType with the provided code or `ResourceType.UNKNOWN` if one cannot be found.static ResourceType
fromString(String str)
Parse the given string as an ACL resource type.boolean
isUnknown()
Return whether this resource type is UNKNOWN.static ResourceType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ResourceType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN
public static final ResourceType UNKNOWN
Represents any ResourceType which this client cannot understand, perhaps because this client is too old.
-
ANY
public static final ResourceType ANY
In a filter, matches any ResourceType.
-
TOPIC
public static final ResourceType TOPIC
A Kafka topic.
-
GROUP
public static final ResourceType GROUP
A consumer group.
-
CLUSTER
public static final ResourceType CLUSTER
The cluster as a whole.
-
TRANSACTIONAL_ID
public static final ResourceType TRANSACTIONAL_ID
A transactional ID.
-
DELEGATION_TOKEN
public static final ResourceType DELEGATION_TOKEN
A token ID.
-
-
Method Detail
-
values
public static ResourceType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ResourceType c : ResourceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResourceType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromString
public static ResourceType fromString(String str) throws IllegalArgumentException
Parse the given string as an ACL resource type.- Parameters:
str
- The string to parse.- Returns:
- The ResourceType, or UNKNOWN if the string could not be matched.
- Throws:
IllegalArgumentException
-
fromCode
public static ResourceType fromCode(byte code)
Return the ResourceType with the provided code or `ResourceType.UNKNOWN` if one cannot be found.
-
code
public byte code()
Return the code of this resource.
-
isUnknown
public boolean isUnknown()
Return whether this resource type is UNKNOWN.
-
-