public class Topic extends java.lang.Object implements ITopic
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name |
protected java.util.Map<ITransformationStep,java.util.List<IMessage<?>>> |
subscriberMap |
Constructor and Description |
---|
Topic(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(IMessage<?> message)
Adds the provided message to this topic
|
void |
addSubscriber(ITransformationStep subscriber)
Adds a new subscriber to this topic
|
java.util.List<IMessage<?>> |
getMessages(ITransformationStep sub)
Returns every message sent to the given subscriber
|
java.lang.String |
getName() |
java.util.List<ITransformationStep> |
getSubscribers()
Returns the subscribers of this topic
|
void |
removeMessage(IMessage<?> message)
Removes the given message from every subscriber
|
void |
removeMessage(IMessage<?> message,
ITransformationStep sub)
Removes the message from the specified step.
|
void |
setName(java.lang.String name) |
protected java.lang.String name
protected java.util.Map<ITransformationStep,java.util.List<IMessage<?>>> subscriberMap
public void addMessage(IMessage<?> message)
ITopic
addMessage
in interface ITopic
message
- Message added to this topicpublic void addSubscriber(ITransformationStep subscriber)
ITopic
addSubscriber
in interface ITopic
public java.util.List<IMessage<?>> getMessages(ITransformationStep sub)
ITopic
getMessages
in interface ITopic
public java.util.List<ITransformationStep> getSubscribers()
ITopic
getSubscribers
in interface ITopic
public void removeMessage(IMessage<?> message)
ITopic
removeMessage
in interface ITopic
public void removeMessage(IMessage<?> message, ITransformationStep sub)
removeMessage
in interface ITopic
message
- Message to be removedsub
- Specified subscriber