Interface MessagingService
-
public interface MessagingServiceThis interface contains properties and methods required for Messaging Service.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CacheEventDescriptoraddCacheNotificationListener(CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes, EventDataFilter eventDataFilter)Registers cache notification of specified event types against all keys in the cache.voidaddCacheNotificationListener(java.lang.Iterable<java.lang.String> keys, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes, EventDataFilter eventDataFilter)Registers cache notification against specified keys in cache.voidaddCacheNotificationListener(java.lang.String key, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes, EventDataFilter eventDataFilter)Registers cache notificationEventTypeof type item added, updated or removed against specified key in cache.TopiccreateTopic(java.lang.String topicName)Creates and retrieves the topic instance against the specified topic name and priority TopicPriority.Normal.TopiccreateTopic(java.lang.String topicName, TopicPriority topicPriority)Creates and retrieves the topic instance against the specified topic name and priority.voiddeleteTopic(java.lang.String topicName)Deletes the topic instance against the specified topic name.java.util.concurrent.FutureTaskdeleteTopicAsync(java.lang.String topicName)Deletes the topic instance asynchronously, against the specified topic name.TopicgetTopic(java.lang.String topicName)Retrieves the topic instance against the topic name.TopicgetTopic(java.lang.String topicName, TopicSearchOptions searchOptions)Retrieves the topic instance against theTopicSearchOptionsand provided name or pattern.voidregisterCQ(ContinuousQuery query)Registers the specified Continuous Query with the cache server.voidremoveCacheNotificationListener(CacheEventDescriptor descriptor)Unregisters a cache level event that may have been registered.voidremoveCacheNotificationListener(java.lang.Iterable<java.lang.String> keys, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes)Unregisters cache notification against specified keys in cache.voidremoveCacheNotificationListener(java.lang.String key, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes)Unregisters theCacheDataModificationListeneralready registered for the specified key.voidunRegisterCQ(ContinuousQuery query)Unregisters an already registered Continuous Query to deactivate it on the cache server.
-
-
-
Method Detail
-
getTopic
Topic getTopic(java.lang.String topicName) throws CacheException, java.lang.IllegalArgumentException
Retrieves the topic instance against the topic name.- Parameters:
topicName- Name to identify topic.- Returns:
- Returns the topic instance, null if it does not exist.
- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
getTopic
Topic getTopic(java.lang.String topicName, TopicSearchOptions searchOptions) throws CacheException, java.lang.IllegalArgumentException
Retrieves the topic instance against theTopicSearchOptionsand provided name or pattern.- Parameters:
topicName- Name or pattern to identify topic.searchOptions-TopicSearchOptionsspecifies to search topic by name or pattern.- Returns:
- Returns the topic instance, null if it does not exist.
- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
createTopic
Topic createTopic(java.lang.String topicName, TopicPriority topicPriority) throws CacheException, java.lang.IllegalArgumentException
Creates and retrieves the topic instance against the specified topic name and priority.- Parameters:
topicName- Name to identify topic.topicPriority- Topic priority is an optional parameter which has a default value of TopicPriority.Normal.- Returns:
- Returns the topic instance, null if it does not exist.
- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
createTopic
Topic createTopic(java.lang.String topicName) throws CacheException, java.lang.IllegalArgumentException
Creates and retrieves the topic instance against the specified topic name and priority TopicPriority.Normal.- Parameters:
topicName- Name to identify topic.- Returns:
- The topic instance, null if it does not exist.
- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
deleteTopic
void deleteTopic(java.lang.String topicName) throws CacheException, java.lang.IllegalArgumentExceptionDeletes the topic instance against the specified topic name.- Parameters:
topicName- Name to identify topic.- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
deleteTopicAsync
java.util.concurrent.FutureTask deleteTopicAsync(java.lang.String topicName) throws CacheException, java.lang.IllegalArgumentExceptionDeletes the topic instance asynchronously, against the specified topic name.- Parameters:
topicName- Name to identify topic.- Returns:
- Future task that performs a delete topic operation in background. Methods of
FutureTaskcan be used to determine status of the task, i.e., isDone(), isCancelled(). - Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
registerCQ
void registerCQ(ContinuousQuery query) throws CacheException, java.lang.IllegalArgumentException
Registers the specified Continuous Query with the cache server. You can use this method multiple times in your application depending on its need to receive the notifications for a change in the dataset of your query. This method takes as argument an object of ContinuousQuery which has the query and the listeners registered to it.- Parameters:
query- SQL-like query to be executed on cache.- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
addCacheNotificationListener
void addCacheNotificationListener(java.lang.String key, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes, EventDataFilter eventDataFilter) throws CacheException, java.lang.IllegalArgumentExceptionRegisters cache notificationEventTypeof type item added, updated or removed against specified key in cache.- Parameters:
key- Unique key to identify the cache item.listener- The specific method of interfaceCacheDataModificationListeneris invoked when specified event/events are triggered against the specified key in cache.eventTypes- An enumset that specifies which event/events are to be registered against the key.eventDataFilter- Tells whether to receive metadata, data with metadata or none when a notification is triggered.- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
addCacheNotificationListener
void addCacheNotificationListener(java.lang.Iterable<java.lang.String> keys, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes, EventDataFilter eventDataFilter) throws CacheException, java.lang.IllegalArgumentExceptionRegisters cache notification against specified keys in cache.- Parameters:
keys-IterableList of keys to identify the cache item.listener- The specific method of interfaceCacheDataModificationListeneris invoked when specified event/events are triggered against specified key in cache.eventTypes- An enumset that specifies which event/events are to be registered against the key.eventDataFilter- Tells whether to receive metadata, data with metadata or none when a notification is triggered.- Throws:
CacheExceptionjava.lang.IllegalArgumentException
-
addCacheNotificationListener
CacheEventDescriptor addCacheNotificationListener(CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes, EventDataFilter eventDataFilter) throws CacheException, java.lang.IllegalArgumentException
Registers cache notification of specified event types against all keys in the cache.- Parameters:
listener- The specific method of interfaceCacheDataModificationListeneris invoked when specified event/events are triggered against the specified key in cache.eventTypes- An enumset that specifies which event/events are to be registered against the key.eventDataFilter- Tells whether to receive metadata, data with metadata or none when a notification is triggered.- Returns:
- Instance of
CacheEventDescriptorrequired to unregister the notifications. - Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
unRegisterCQ
void unRegisterCQ(ContinuousQuery query) throws java.lang.Exception
Unregisters an already registered Continuous Query to deactivate it on the cache server. Like registerCQ, it takes as argument an object of ContinuousQuery to unregister the listeners which are no more fired after this call. This method is used when the user is no more interested in receiving notifications for changes in a query result set.- Parameters:
query- SQL-like query to be executed over the cache.- Throws:
java.lang.Exception- So you can catch this exception for all the exceptions thrown from within the NCache.
-
removeCacheNotificationListener
void removeCacheNotificationListener(CacheEventDescriptor descriptor) throws java.lang.Exception
Unregisters a cache level event that may have been registered.- Parameters:
descriptor- The descriptor returned when the general event was registered.- Throws:
java.lang.Exception- So you can catch this exception for all the exceptions thrown from within the NCache.
-
removeCacheNotificationListener
void removeCacheNotificationListener(java.lang.String key, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes) throws CacheException, java.lang.IllegalArgumentExceptionUnregisters theCacheDataModificationListeneralready registered for the specified key.- Parameters:
key- Unique key to identify the cache item.listener- TheCacheDataModificationListenerthat is invoked when specified event/events are triggered in cache.eventTypes- An enumset that specifies which event/events are to be unregistered against the key.- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
removeCacheNotificationListener
void removeCacheNotificationListener(java.lang.Iterable<java.lang.String> keys, CacheDataModificationListener listener, java.util.EnumSet<EventType> eventTypes) throws CacheException, java.lang.IllegalArgumentExceptionUnregisters cache notification against specified keys in cache.- Parameters:
keys-Iterablelist of keys to identify the cache item.listener- TheCacheDataModificationListenerthat is invoked when specified event/events are triggered against specified keys in cache.eventTypes- An enumset that specifies which event/events are to be unregistered against the key.- Throws:
CacheException- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
-
-