Class ResourcePattern

java.lang.Object
io.confluent.security.authorizer.ResourcePattern
All Implemented Interfaces:
Comparable<ResourcePattern>

public class ResourcePattern extends Object implements Comparable<ResourcePattern>
Represents a resource pattern that can be used to define an AccessRule. This uses resource types that are not pre-defined, enabling this class to be used for defining rules in different components.
  • Field Details

  • Constructor Details

    • ResourcePattern

      public ResourcePattern(String type, String name, org.apache.kafka.common.resource.PatternType patternType)
    • ResourcePattern

      public ResourcePattern(io.confluent.security.roledefinitions.ResourceType resourceType, String name, org.apache.kafka.common.resource.PatternType patternType)
  • Method Details

    • name

      public String name()
    • resourceType

      public io.confluent.security.roledefinitions.ResourceType resourceType()
    • patternType

      public org.apache.kafka.common.resource.PatternType patternType()
    • toFilter

      public ResourcePatternFilter toFilter()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      AclBindingKey(ResourcePattern, Scope) is used to determine the _confluent-metadata-auth topic partition for storing AclBindingKey/Value. To make hashCode() constant across executions, we are using patternType.name() to compute the hashCode of ResourcePattern,
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(ResourcePattern other)
      Specified by:
      compareTo in interface Comparable<ResourcePattern>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • all

      public static ResourcePattern all(io.confluent.security.roledefinitions.ResourceType resourceType)
    • from

      public static ResourcePattern from(org.apache.kafka.common.resource.ResourcePattern resourcePattern)
    • to

      public static org.apache.kafka.common.resource.ResourcePattern to(ResourcePattern resourcePattern)
    • from

      public static ResourcePattern from(org.apache.kafka.common.resource.ResourcePatternFilter resourcePattern)