Class NamespaceName

java.lang.Object
org.apache.pulsar.common.naming.NamespaceName
All Implemented Interfaces:
ServiceUnitId

public class NamespaceName extends Object implements ServiceUnitId
Parser of a value from the namespace field provided in configuration.
  • Field Details

    • SYSTEM_NAMESPACE

      public static final NamespaceName SYSTEM_NAMESPACE
  • Method Details

    • get

      public static NamespaceName get(String tenant, String namespace)
    • get

      public static NamespaceName get(String tenant, String cluster, String namespace)
    • get

      public static NamespaceName get(String namespace)
    • getIfValid

      public static Optional<NamespaceName> getIfValid(String namespace)
    • getTenant

      public String getTenant()
    • getCluster

      @Deprecated public String getCluster()
      Deprecated.
    • getLocalName

      public String getLocalName()
    • isGlobal

      public boolean isGlobal()
    • getPersistentTopicName

      public String getPersistentTopicName(String localTopic)
    • toString

      public String toString()
      Specified by:
      toString in interface ServiceUnitId
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • validateNamespaceName

      public static void validateNamespaceName(String tenant, String namespace)
    • validateNamespaceName

      public static void validateNamespaceName(String tenant, String cluster, String namespace)
    • getNamespaceObject

      public NamespaceName getNamespaceObject()
      Description copied from interface: ServiceUnitId
      Return the namespace object that this ServiceUnitId belongs to.
      Specified by:
      getNamespaceObject in interface ServiceUnitId
      Returns:
      NamespaceName object
    • includes

      public boolean includes(TopicName topicName)
      Description copied from interface: ServiceUnitId
      Check whether a fully-qualified topic is included in this ServiceUnitId object.
      Specified by:
      includes in interface ServiceUnitId
      Parameters:
      topicName - a fully-qualified topic object
      Returns:
      true or false
    • isV2

      public boolean isV2()
      Returns true if this is a V2 namespace prop/namespace-name.
      Returns:
      true if v2