Interface MessagingService


  • public interface MessagingService
    This interface contains properties and methods required for Messaging Service.
    • 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 the TopicSearchOptions and provided name or pattern.
        Parameters:
        topicName - Name or pattern to identify topic.
        searchOptions - TopicSearchOptions specifies 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.IllegalArgumentException
        Deletes 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.IllegalArgumentException
        Deletes 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 FutureTask can 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.IllegalArgumentException
        Registers cache notification EventType of 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 interface CacheDataModificationListener is 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.IllegalArgumentException
        Registers cache notification against specified keys in cache.
        Parameters:
        keys - Iterable List of keys to identify the cache item.
        listener - The specific method of interface CacheDataModificationListener is 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:
        CacheException
        java.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 interface CacheDataModificationListener is 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 CacheEventDescriptor required 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.IllegalArgumentException
        Unregisters the CacheDataModificationListener already registered for the specified key.
        Parameters:
        key - Unique key to identify the cache item.
        listener - The CacheDataModificationListener that 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.IllegalArgumentException
        Unregisters cache notification against specified keys in cache.
        Parameters:
        keys - Iterable list of keys to identify the cache item.
        listener - The CacheDataModificationListener that 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