Package org.apache.pulsar.common.naming
Class NamespaceName
- java.lang.Object
-
- org.apache.pulsar.common.naming.NamespaceName
-
- All Implemented Interfaces:
ServiceUnitId
public class NamespaceName extends java.lang.Object implements ServiceUnitId
Parser of a value from the namespace field provided in configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static NamespaceNameSYSTEM_NAMESPACE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static NamespaceNameget(java.lang.String namespace)static NamespaceNameget(java.lang.String tenant, java.lang.String namespace)static NamespaceNameget(java.lang.String tenant, java.lang.String cluster, java.lang.String namespace)java.lang.StringgetCluster()Deprecated.static java.util.Optional<NamespaceName>getIfValid(java.lang.String namespace)java.lang.StringgetLocalName()NamespaceNamegetNamespaceObject()Return the namespace object that thisServiceUnitIdbelongs to.java.lang.StringgetPersistentTopicName(java.lang.String localTopic)java.lang.StringgetTenant()inthashCode()booleanincludes(TopicName topicName)Check whether a fully-qualified topic is included in thisServiceUnitIdobject.booleanisGlobal()booleanisV2()Returns true if this is a V2 namespace prop/namespace-name.java.lang.StringtoString()static voidvalidateNamespaceName(java.lang.String tenant, java.lang.String namespace)static voidvalidateNamespaceName(java.lang.String tenant, java.lang.String cluster, java.lang.String namespace)
-
-
-
Field Detail
-
SYSTEM_NAMESPACE
public static final NamespaceName SYSTEM_NAMESPACE
-
-
Method Detail
-
get
public static NamespaceName get(java.lang.String tenant, java.lang.String namespace)
-
get
public static NamespaceName get(java.lang.String tenant, java.lang.String cluster, java.lang.String namespace)
-
get
public static NamespaceName get(java.lang.String namespace)
-
getIfValid
public static java.util.Optional<NamespaceName> getIfValid(java.lang.String namespace)
-
getTenant
public java.lang.String getTenant()
-
getCluster
@Deprecated public java.lang.String getCluster()
Deprecated.
-
getLocalName
public java.lang.String getLocalName()
-
isGlobal
public boolean isGlobal()
-
getPersistentTopicName
public java.lang.String getPersistentTopicName(java.lang.String localTopic)
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfaceServiceUnitId- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
validateNamespaceName
public static void validateNamespaceName(java.lang.String tenant, java.lang.String namespace)
-
validateNamespaceName
public static void validateNamespaceName(java.lang.String tenant, java.lang.String cluster, java.lang.String namespace)
-
getNamespaceObject
public NamespaceName getNamespaceObject()
Description copied from interface:ServiceUnitIdReturn the namespace object that thisServiceUnitIdbelongs to.- Specified by:
getNamespaceObjectin interfaceServiceUnitId- Returns:
- NamespaceName object
-
includes
public boolean includes(TopicName topicName)
Description copied from interface:ServiceUnitIdCheck whether a fully-qualified topic is included in thisServiceUnitIdobject.- Specified by:
includesin interfaceServiceUnitId- 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
-
-