public class TopicName extends Object implements ServiceUnitId
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NAMESPACE |
static String |
PARTITIONED_TOPIC_SUFFIX |
static String |
PUBLIC_TENANT |
static TopicName |
TRANSACTION_COORDINATOR_ASSIGN |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static TopicName |
get(String topic) |
static TopicName |
get(String domain,
NamespaceName namespaceName,
String topic) |
static TopicName |
get(String domain,
String tenant,
String namespace,
String topic) |
static TopicName |
get(String domain,
String tenant,
String cluster,
String namespace,
String topic) |
String |
getCluster()
Deprecated.
|
TopicDomain |
getDomain() |
String |
getEncodedLocalName() |
String |
getLocalName() |
String |
getLookupName()
Get a string suitable for completeTopicName lookup.
|
String |
getNamespace()
Extract the namespace portion out of a completeTopicName name.
|
NamespaceName |
getNamespaceObject()
Get the namespace object that this completeTopicName belongs to.
|
String |
getNamespacePortion() |
TopicName |
getPartition(int index) |
String |
getPartitionedTopicName()
For partitions in a topic, return the base partitioned topic name.
|
int |
getPartitionIndex() |
static int |
getPartitionIndex(String topic) |
String |
getPersistenceNamingEncoding()
Returns the name of the persistence resource associated with the completeTopicName.
|
String |
getRestPath()
Returns the http rest path for use in the admin web service.
|
String |
getRestPath(boolean includeDomain) |
String |
getSchemaName() |
String |
getTenant() |
int |
hashCode() |
boolean |
includes(TopicName otherTopicName)
Check whether a fully-qualified topic is included in this
ServiceUnitId object. |
boolean |
isGlobal() |
boolean |
isPartitioned() |
boolean |
isPersistent() |
boolean |
isV2()
Returns true if this a V2 topic name prop/ns/topic-name.
|
static boolean |
isValid(String topic) |
String |
toString() |
public static final String PUBLIC_TENANT
public static final String DEFAULT_NAMESPACE
public static final String PARTITIONED_TOPIC_SUFFIX
public static final TopicName TRANSACTION_COORDINATOR_ASSIGN
public static TopicName get(String domain, NamespaceName namespaceName, String topic)
public static TopicName get(String domain, String tenant, String cluster, String namespace, String topic)
public static boolean isValid(String topic)
public boolean isPersistent()
public String getNamespace()
Works both with old & new convention.
public NamespaceName getNamespaceObject()
getNamespaceObject in interface ServiceUnitIdpublic TopicDomain getDomain()
public String getTenant()
@Deprecated public String getCluster()
public String getNamespacePortion()
public String getLocalName()
public String getEncodedLocalName()
public TopicName getPartition(int index)
public int getPartitionIndex()
public boolean isPartitioned()
public String getPartitionedTopicName()
persistent://prop/cluster/ns/my-topic-partition-1 -->
persistent://prop/cluster/ns/my-topic
persistent://prop/cluster/ns/my-topic --> persistent://prop/cluster/ns/my-topic
public static int getPartitionIndex(String topic)
public String getRestPath()
public String getRestPath(boolean includeDomain)
public String getPersistenceNamingEncoding()
public String getLookupName()
Example:
persistent://tenant/cluster/namespace/completeTopicName -> persistent/tenant/cluster/namespace/completeTopicName
public boolean isGlobal()
public String getSchemaName()
public String toString()
toString in interface ServiceUnitIdtoString in class Objectpublic boolean includes(TopicName otherTopicName)
ServiceUnitIdServiceUnitId object.includes in interface ServiceUnitIdotherTopicName - a fully-qualified topic objectpublic boolean isV2()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.