Package org.symphonyoss.s2.fugue.pubsub
Class Topic
- java.lang.Object
-
- org.symphonyoss.s2.fugue.pubsub.Topic
-
public class Topic extends Object
A topic as represented in the Fugue API. This is simply a representation of the parameters of a Topic so that it can be passed through the API. A Topic always has an id, it has a serviceId which defaults to the current service, in which case it is represented as null in this class. It may also have an obsolete ID, which may also be null in this class. The eventual name for a Topic is ${environmentType}-${environmentId}-${serviceId}-${topicId}- Author:
- Bruce Skingle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.symphonyoss.s2.fugue.naming.TopicNamecreateObsoleteTopicName(org.symphonyoss.s2.fugue.naming.INameFactory nameFactory)Create a TopicName for this topic using the given NameFactory.org.symphonyoss.s2.fugue.naming.TopicNamecreateTopicName(org.symphonyoss.s2.fugue.naming.INameFactory nameFactory)Create a TopicName for this topic using the given NameFactory.StringgetId()StringgetObsoleteId()StringgetServiceId()TopicwithObsoleteId(String obsoleteId)Set the obsolete ID for this topic.TopicwithServiceId(String serviceId)Set the service ID for the owner of this topic.
-
-
-
Constructor Detail
-
Topic
public Topic(String id)
Constructor.- Parameters:
id- The topicId (simple name)
-
-
Method Detail
-
withObsoleteId
public Topic withObsoleteId(String obsoleteId)
Set the obsolete ID for this topic. If there are no subscriptions to the topic with the obsolete id then it will be deleted.- Parameters:
obsoleteId- The obsolete topicId.- Returns:
- This (fluent method)
-
withServiceId
public Topic withServiceId(String serviceId)
Set the service ID for the owner of this topic. If no serviceId is specified the current service is assumed. The topic owner is responsible for creation and deletion of the topic.- Parameters:
serviceId- The id of the service which owns the topic.- Returns:
- This (fluent method)
-
getId
public String getId()
- Returns:
- The topic ID (simple name).
-
createTopicName
public org.symphonyoss.s2.fugue.naming.TopicName createTopicName(org.symphonyoss.s2.fugue.naming.INameFactory nameFactory)
Create a TopicName for this topic using the given NameFactory.- Parameters:
nameFactory- The name factory to use (which knows the current environment, service etc)- Returns:
- The fully qualified name for the topic.
-
createObsoleteTopicName
public org.symphonyoss.s2.fugue.naming.TopicName createObsoleteTopicName(org.symphonyoss.s2.fugue.naming.INameFactory nameFactory)
Create a TopicName for this topic using the given NameFactory.- Parameters:
nameFactory- The name factory to use (which knows the current environment, service etc)- Returns:
- The fully qualified name for the topic.
-
-