client-cpp  0.10.0
kaa::INotificationManager Class Referenceabstract

The public interface to topic subscription and notification delivery subsystems. More...

#include <INotificationManager.hpp>

+ Inheritance diagram for kaa::INotificationManager:

Public Member Functions

virtual void addTopicListListener (INotificationTopicListListener &listener)=0
 Adds the listener which receives updates on the list of available topics. More...
 
virtual void removeTopicListListener (INotificationTopicListListener &listener)=0
 Removes listener which receives updates on the list of available topics. More...
 
virtual Topics getTopics ()=0
 Retrieves the list of available topics. More...
 
virtual void addNotificationListener (INotificationListener &listener)=0
 Adds the listener which receives notifications on all available topics. More...
 
virtual void addNotificationListener (std::int64_t topicId, INotificationListener &listener)=0
 Adds the listener which receives notifications on the specified topic. More...
 
virtual void removeNotificationListener (INotificationListener &listener)=0
 Removes the listener which receives notifications on all available topics. More...
 
virtual void removeNotificationListener (std::int64_t topicId, INotificationListener &listener)=0
 Removes the listener which receives notifications on the specified topic. More...
 
virtual void subscribeToTopic (std::int64_t id, bool forceSync=true)=0
 Subscribes to the specified optional topic to receive notifications on that topic. More...
 
virtual void subscribeToTopics (const std::list< std::int64_t > &idList, bool forceSync=true)=0
 Subscribes to the specified list of optional topics to receive notifications on those topics. More...
 
virtual void unsubscribeFromTopic (std::int64_t id, bool forceSync=true)=0
 Unsubscribes from the specified optional topic to stop receiving notifications on that topic. More...
 
virtual void unsubscribeFromTopics (const std::list< std::int64_t > &idList, bool forceSync=true)=0
 Unsubscribes from the specified list of optional topics to stop receiving notifications on those topics. More...
 
virtual void sync ()=0
 Sends subscription request(s) to the Operations server. More...
 
virtual ~INotificationManager ()
 

Detailed Description

The public interface to topic subscription and notification delivery subsystems.

See Also
INotificationListener
INotificationTopicListListener

Definition at line 40 of file INotificationManager.hpp.

Constructor & Destructor Documentation

virtual kaa::INotificationManager::~INotificationManager ( )
inlinevirtual

Definition at line 201 of file INotificationManager.hpp.

Member Function Documentation

virtual void kaa::INotificationManager::addNotificationListener ( INotificationListener listener)
pure virtual

Adds the listener which receives notifications on all available topics.

Parameters
[in]listenerThe listener which receives notifications.
See Also
INotificationListener

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::addNotificationListener ( std::int64_t  topicId,
INotificationListener listener 
)
pure virtual

Adds the listener which receives notifications on the specified topic.

Listener(s) for optional topics may be added/removed irrespective to whether subscription is already done or not.

Parameters
[in]topicIdThe id of the topic (either mandatory or optional).
[in]listenerThe listener which receives notifications.
Exceptions
UnavailableTopicExceptionThrows if the unknown topic id is provided.
See Also
INotificationListener

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::addTopicListListener ( INotificationTopicListListener listener)
pure virtual

Adds the listener which receives updates on the list of available topics.

Parameters
[in]listenerThe listener which receives updates.
See Also
INotificationTopicListListener

Implemented in kaa::NotificationManager.

virtual Topics kaa::INotificationManager::getTopics ( )
pure virtual

Retrieves the list of available topics.

Returns
The list of available topics.

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::removeNotificationListener ( INotificationListener listener)
pure virtual

Removes the listener which receives notifications on all available topics.

Parameters
[in]listenerThe listener which receives notifications.
See Also
INotificationListener

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::removeNotificationListener ( std::int64_t  topicId,
INotificationListener listener 
)
pure virtual

Removes the listener which receives notifications on the specified topic.

Listener(s) for optional topics may be added/removed irrespective to whether subscription is already done or not.

Parameters
[in]topicIdThe id of topic (either mandatory or optional).
[in]listenerThe listener which receives notifications.
Exceptions
UnavailableTopicExceptionThrows if the unknown topic id is provided.
See Also
INotificationListener

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::removeTopicListListener ( INotificationTopicListListener listener)
pure virtual

Removes listener which receives updates on the list of available topics.

Parameters
[in]listenerThe listener which receives updates.
See Also
INotificationTopicListListener

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::subscribeToTopic ( std::int64_t  id,
bool  forceSync = true 
)
pure virtual

Subscribes to the specified optional topic to receive notifications on that topic.

Parameters
[in]topicIdThe id of the optional topic.
[in]forceSyncIndicates whether the subscription request should be sent immediately to the Operations server. If false , the request postpones to the explicit call of sync() or to the first call of subscribeToTopic(), subscribeToTopics(), unsubscribeFromTopic() or unsubscribeFromTopics() with the true value for the forceSync parameter.
Exceptions
UnavailableTopicExceptionThrows if the unknown topic id is provided or the topic isn't optional.
See Also
sync()

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::subscribeToTopics ( const std::list< std::int64_t > &  idList,
bool  forceSync = true 
)
pure virtual

Subscribes to the specified list of optional topics to receive notifications on those topics.

Parameters
[in]topicIdsThe list of optional topic id-s.
[in]forceSyncIndicates whether the subscription request should be sent immediately to the Operations server. If false , the request postpones to the explicit call of sync() or to the first call of subscribeToTopic(), subscribeToTopics(), unsubscribeFromTopic() or unsubscribeFromTopics() with the true value for the forceSync parameter.
Exceptions
UnavailableTopicExceptionThrows if the unknown topic id is provided or the topic isn't optional.
See Also
sync()

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::sync ( )
pure virtual

Sends subscription request(s) to the Operations server.

Use as a convenient way to send several subscription requests at once.

IKaaClient& kaaClient = Kaa::getKaaClient();
// Add listener(s) to receive notifications on topic(s)
kaaClient.subscribeToTopics({"optional_topic1_id", "optional_topic2_id"}, false);
kaaClient.unsubscribeFromTopic("optional_topic3_id", false);
kaaClient.syncTopicSubscriptions();

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::unsubscribeFromTopic ( std::int64_t  id,
bool  forceSync = true 
)
pure virtual

Unsubscribes from the specified optional topic to stop receiving notifications on that topic.

Parameters
[in]topicIdThe id of the optional topic.
[in]forceSyncIndicates whether the subscription request should be sent immediately to the Operations server or postponed. If false , the request is postponed either to the explicit call of sync() or to the first call of one of the following functions with the forceSync parameter set to true : subscribeToTopic(), subscribeToTopics(), unsubscribeFromTopic() or unsubscribeFromTopics() .
Exceptions
UnavailableTopicExceptionThrows if the unknown topic id is provided or the topic isn't optional.
See Also
sync()

Implemented in kaa::NotificationManager.

virtual void kaa::INotificationManager::unsubscribeFromTopics ( const std::list< std::int64_t > &  idList,
bool  forceSync = true 
)
pure virtual

Unsubscribes from the specified list of optional topics to stop receiving notifications on those topics.

Parameters
[in]topicIdThe list of optional topic id-s.
[in]forceSyncIndicates whether the subscription request should be sent immediately to the Operations server or postponed. If false , the request is postponed either to the explicit call of sync() or to the first call of one of the following functions with the forceSync parameter set to true : subscribeToTopic(), subscribeToTopics(), unsubscribeFromTopic() or unsubscribeFromTopics() .
Exceptions
UnavailableTopicExceptionThrows if the unknown topic id is provided or the topic isn't optional.
See Also
sync()

Implemented in kaa::NotificationManager.


The documentation for this class was generated from the following file: