Interface TopicSubscription
-
- All Known Subinterfaces:
DurableTopicSubscription
public interface TopicSubscriptionNCache provides TopicSubscription interface which is returned against the desired topic, containing information for topic subscriptions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMessageReceivedListener(MessageReceivedListener messageReceivedListener)Event to register subscriber against the topic so that it can receive the published messages.TopicgetTopic()Retrieves the topic instance containing information about the topic.voidremoveMessageReceivedListener(MessageReceivedListener messageReceivedListener)Unregisters the user for message received event.voidunSubscribe()This method unsubscribes the topic.
-
-
-
Method Detail
-
getTopic
Topic getTopic()
Retrieves the topic instance containing information about the topic.- Returns:
Topicinstance of the topic, null if it does not exist.
-
addMessageReceivedListener
void addMessageReceivedListener(MessageReceivedListener messageReceivedListener) throws CacheException
Event to register subscriber against the topic so that it can receive the published messages.- Parameters:
messageReceivedListener- The listener that is invoked whenever a message is received.- Throws:
CacheException
-
removeMessageReceivedListener
void removeMessageReceivedListener(MessageReceivedListener messageReceivedListener) throws CacheException
Unregisters the user for message received event.- Parameters:
messageReceivedListener- The instance of the registerd message received listener.- Throws:
CacheException
-
unSubscribe
void unSubscribe() throws java.lang.ExceptionThis method unsubscribes the topic.- Throws:
java.lang.Exception
-
-