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 |
| 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
Eg:
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
|
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
Eg:
* "persistent/my-tenant/my-namespace/my-topic"
* "non-persistent/my-tenant/my-namespace/my-topic"
|
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 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()
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 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 objectincludes in interface ServiceUnitIdotherTopicName - a fully-qualified topic objectpublic boolean isV2()
Copyright © 2017–2018 Apache Software Foundation. All rights reserved.