client-cpp  0.7.0
kaa::IKaaClient Class Referenceabstract

#include <IKaaClient.hpp>

+ Inheritance diagram for kaa::IKaaClient:

Public Member Functions

virtual void setProfileContainer (IProfileContainerPtr container)=0
 
virtual void updateProfile ()=0
 
virtual EventFamilyFactory & getEventFamilyFactory ()=0
 
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 (const std::string &topidId, 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 (const std::string &topidId, INotificationListener &listener)=0
 Removes the listener which receives notifications on the specified topic. More...
 
virtual void subscribeToTopic (const std::string &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::string > &idList, bool forceSync=true)=0
 Subscribes to the specified list of optional topics to receive notifications on those topics. More...
 
virtual void unsubscribeFromTopic (const std::string &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::string > &idList, bool forceSync=true)=0
 Unsubscribes from the specified list of optional topics to stop receiving notifications on those topics. More...
 
virtual void syncTopicSubscriptions ()=0
 Sends subscription request(s) to the Operations server. More...
 
virtual void addConfigurationListener (IConfigurationReceiver &receiver)=0
 
virtual void removeConfigurationListener (IConfigurationReceiver &receiver)=0
 
virtual const
KaaRootConfiguration & 
getConfiguration ()=0
 
virtual void setConfigurationStorage (IConfigurationStoragePtr storage)=0
 
virtual void attachEndpoint (const std::string &endpointAccessToken, IAttachEndpointCallbackPtr listener=IAttachEndpointCallbackPtr())=0
 Attaches the specified endpoint to the user to which the current endpoint is attached. More...
 
virtual void detachEndpoint (const std::string &endpointKeyHash, IDetachEndpointCallbackPtr listener=IDetachEndpointCallbackPtr())=0
 Detaches the specified endpoint from the user to which the current endpoint is attached. More...
 
virtual void attachUser (const std::string &userExternalId, const std::string &userAccessToken, IUserAttachCallbackPtr listener=IUserAttachCallbackPtr())=0
 Attaches the current endpoint to the specifier user. The user verification is carried out by the default verifier. More...
 
virtual void attachUser (const std::string &userExternalId, const std::string &userAccessToken, const std::string &userVerifierToken, IUserAttachCallbackPtr listener=IUserAttachCallbackPtr())=0
 
virtual void setAttachStatusListener (IAttachStatusListenerPtr listener)=0
 Sets listener to notify of the current endpoint is attached/detached by another one. More...
 
virtual bool isAttachedToUser ()=0
 Checks if the current endpoint is already attached to some user. More...
 
virtual std::int32_t findEventListeners (const std::list< std::string > &eventFQNs, IFetchEventListenersPtr listener)=0
 Submits an event listeners resolution request. More...
 
virtual void addLogRecord (const KaaUserLogRecord &record)=0
 Adds a new log record to the log storage. More...
 
virtual void setLogStorage (ILogStoragePtr storage)=0
 Sets the new log storage. More...
 
virtual void setLogUploadStrategy (ILogUploadStrategyPtr strategy)=0
 Sets the new log upload strategy. More...
 
virtual IKaaChannelManagergetChannelManager ()=0
 Retrieves the Channel Manager. More...
 
virtual const KeyPairgetClientKeyPair ()=0
 Retrieves the client's public and private key. More...
 
virtual void setEndpointAccessToken (const std::string &token)=0
 Set new access token for a current endpoint. More...
 
virtual std::string refreshEndpointAccessToken ()=0
 Generate new access token for a current endpoint. More...
 
virtual std::string getEndpointAccessToken ()=0
 Retrieve an access token for a current endpoint. More...
 
virtual IKaaDataMultiplexergetOperationMultiplexer ()=0
 Retrieves Kaa operations data multiplexer. More...
 
virtual IKaaDataDemultiplexergetOperationDemultiplexer ()=0
 Retrieves Kaa operations data demultiplexer. More...
 
virtual IKaaDataMultiplexergetBootstrapMultiplexer ()=0
 Retrieves Kaa bootstrap data multiplexer. More...
 
virtual IKaaDataDemultiplexergetBootstrapDemultiplexer ()=0
 Retrieves Kaa bootstrap data demultiplexer. More...
 
virtual ~IKaaClient ()
 

Detailed Description

Interface for the Kaa client.

Base interface to operate with Kaa library.

Author
Yaroslav Zeygerman

Definition at line 51 of file IKaaClient.hpp.

Constructor & Destructor Documentation

virtual kaa::IKaaClient::~IKaaClient ( )
inlinevirtual

Definition at line 438 of file IKaaClient.hpp.

Member Function Documentation

virtual void kaa::IKaaClient::addConfigurationListener ( IConfigurationReceiver receiver)
pure virtual

Subscribes listener of configuration updates.

Parameters
receiverListener to be added to notification list.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::addLogRecord ( const KaaUserLogRecord &  record)
pure virtual

Adds a new log record to the log storage.

To store log records, MemoryLogStorage is used by default. Use setStorage() to set your own implementation.

Parameters
[in]recordThe log record to be added.
See also
KaaUserLogRecord
ILogStorage

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::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::KaaClient.

virtual void kaa::IKaaClient::addNotificationListener ( const std::string &  topidId,
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::KaaClient.

virtual void kaa::IKaaClient::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::KaaClient.

virtual void kaa::IKaaClient::attachEndpoint ( const std::string &  endpointAccessToken,
IAttachEndpointCallbackPtr  listener = IAttachEndpointCallbackPtr() 
)
pure virtual

Attaches the specified endpoint to the user to which the current endpoint is attached.

Parameters
[in]endpointAccessTokenThe access token of the endpoint to be attached to the user.
[in]listenerThe optional listener to notify of the result.
Exceptions
BadCredentialsThe endpoint access token is empty.
TransportNotFoundExceptionThe Kaa SDK isn't fully initialized.
KaaExceptionSome other failure has happened.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::attachUser ( const std::string &  userExternalId,
const std::string &  userAccessToken,
IUserAttachCallbackPtr  listener = IUserAttachCallbackPtr() 
)
pure virtual

Attaches the current endpoint to the specifier user. The user verification is carried out by the default verifier.

NOTE: If the default user verifier (DEFAULT_USER_VERIFIER_TOKEN) is not specified, the attach attempt fails with the KaaException exception.

Only endpoints associated with the same user can exchange events.

Parameters
[in]userExternalIdThe external user ID.
[in]userAccessTokenThe user access token.
Exceptions
BadCredentialsThe endpoint access token is empty.
TransportNotFoundExceptionThe Kaa SDK isn't fully initialized.
KaaExceptionSome other failure has happened.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::attachUser ( const std::string &  userExternalId,
const std::string &  userAccessToken,
const std::string &  userVerifierToken,
IUserAttachCallbackPtr  listener = IUserAttachCallbackPtr() 
)
pure virtual

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::detachEndpoint ( const std::string &  endpointKeyHash,
IDetachEndpointCallbackPtr  listener = IDetachEndpointCallbackPtr() 
)
pure virtual

Detaches the specified endpoint from the user to which the current endpoint is attached.

Parameters
[in]endpointKeyHashThe key hash of the endpoint to be detached from the user.
[in]listenerThe optional listener to notify of the result.
Exceptions
BadCredentialsThe endpoint access token is empty.
TransportNotFoundExceptionThe Kaa SDK isn't fully initialized.
KaaExceptionSome other failure has happened.

Implemented in kaa::KaaClient.

virtual std::int32_t kaa::IKaaClient::findEventListeners ( const std::list< std::string > &  eventFQNs,
IFetchEventListenersPtr  listener 
)
pure virtual

Submits an event listeners resolution request.

Parameters
eventFQNsList of event class FQNs which have to be supported by endpoint.
listenerResult listener IFetchEventListeners}
Exceptions
KaaExceptionwhen data is invalid (empty list or null listener)
Returns
Request ID of submitted request

Implemented in kaa::KaaClient.

virtual IKaaDataDemultiplexer& kaa::IKaaClient::getBootstrapDemultiplexer ( )
pure virtual

Retrieves Kaa bootstrap data demultiplexer.

Returns
IKaaDataDemultiplexer object

Implemented in kaa::KaaClient.

virtual IKaaDataMultiplexer& kaa::IKaaClient::getBootstrapMultiplexer ( )
pure virtual

Retrieves Kaa bootstrap data multiplexer.

Returns
IKaaDataMultiplexer object

Implemented in kaa::KaaClient.

virtual IKaaChannelManager& kaa::IKaaClient::getChannelManager ( )
pure virtual

Retrieves the Channel Manager.

Implemented in kaa::KaaClient.

virtual const KeyPair& kaa::IKaaClient::getClientKeyPair ( )
pure virtual

Retrieves the client's public and private key.

Required in user implementation of an operation data channel. Public key hash (SHA-1) is used by servers as identification number to uniquely identify each connected endpoint.

Private key is used by encryption schema between endpoint and servers.

Returns
client's public/private key pair

Implemented in kaa::KaaClient.

virtual const KaaRootConfiguration& kaa::IKaaClient::getConfiguration ( )
pure virtual

Returns full configuration tree which is actual at current moment.

Returns
ICommonRecord containing current configuration tree.

Implemented in kaa::KaaClient.

virtual std::string kaa::IKaaClient::getEndpointAccessToken ( )
pure virtual

Retrieve an access token for a current endpoint.

Returns
The current access token.

Implemented in kaa::KaaClient.

virtual EventFamilyFactory& kaa::IKaaClient::getEventFamilyFactory ( )
pure virtual

Retrieves Kaa event family factory.

Returns
EventFamilyFactory object.

Implemented in kaa::KaaClient.

virtual IKaaDataDemultiplexer& kaa::IKaaClient::getOperationDemultiplexer ( )
pure virtual

Retrieves Kaa operations data demultiplexer.

Returns
IKaaDataDemultiplexer object

Implemented in kaa::KaaClient.

virtual IKaaDataMultiplexer& kaa::IKaaClient::getOperationMultiplexer ( )
pure virtual

Retrieves Kaa operations data multiplexer.

Returns
IKaaDataMultiplexer object

Implemented in kaa::KaaClient.

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

Retrieves the list of available topics.

Returns
The list of available topics.

Implemented in kaa::KaaClient.

virtual bool kaa::IKaaClient::isAttachedToUser ( )
pure virtual

Checks if the current endpoint is already attached to some user.

Returns
TRUE if the current endpoint is attached, FALSE otherwise.

Implemented in kaa::KaaClient.

virtual std::string kaa::IKaaClient::refreshEndpointAccessToken ( )
pure virtual

Generate new access token for a current endpoint.

Returns
The new access token.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::removeConfigurationListener ( IConfigurationReceiver receiver)
pure virtual

Unsubscribes listener of configuration updates.

Parameters
receiverListener to be removed from notification list.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::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::KaaClient.

virtual void kaa::IKaaClient::removeNotificationListener ( const std::string &  topidId,
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::KaaClient.

virtual void kaa::IKaaClient::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::KaaClient.

virtual void kaa::IKaaClient::setAttachStatusListener ( IAttachStatusListenerPtr  listener)
pure virtual

Sets listener to notify of the current endpoint is attached/detached by another one.

Parameters
[in]listenerListener to notify of the attach status is changed.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::setConfigurationStorage ( IConfigurationStoragePtr  storage)
pure virtual

Registers new configuration persistence routines. Replaces previously set value. Memory pointed by given parameter should be managed by user.

Parameters
storageUser-defined persistence routines.
See also
IConfigurationStorage

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::setEndpointAccessToken ( const std::string &  token)
pure virtual

Set new access token for a current endpoint.

Parameters
[in]tokenThe new access token.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::setLogStorage ( ILogStoragePtr  storage)
pure virtual

Sets the new log storage.

MemoryLogStorage is used by default.

Parameters
[in]storageThe ILogStorage implementation.
Exceptions
KaaExceptionThe storage is NULL.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::setLogUploadStrategy ( ILogUploadStrategyPtr  strategy)
pure virtual

Sets the new log upload strategy.

DefaultLogUploadStrategy is used by default.

Parameters
[in]strategyThe ILogUploadStrategy implementation.
Exceptions
KaaExceptionThe strategy is NULL.

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::setProfileContainer ( IProfileContainerPtr  container)
pure virtual

Sets profile container implemented by the user.

Parameters
containerUser-defined container
See also
AbstractProfileContainer

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::subscribeToTopic ( const std::string &  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 syncTopicSubscriptions() 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
syncTopicSubscriptions()

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::subscribeToTopics ( const std::list< std::string > &  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 syncTopicSubscriptions() 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
syncTopicSubscriptions()

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::syncTopicSubscriptions ( )
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::KaaClient.

virtual void kaa::IKaaClient::unsubscribeFromTopic ( const std::string &  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. If false , the request postpones to the explicit call of syncTopicSubscriptions() 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
syncTopicSubscriptions()

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::unsubscribeFromTopics ( const std::list< std::string > &  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. If false , the request postpones to the explicit call of syncTopicSubscriptions() 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
syncTopicSubscriptions()

Implemented in kaa::KaaClient.

virtual void kaa::IKaaClient::updateProfile ( )
pure virtual

Notyfies server about profile changes

Implemented in kaa::KaaClient.


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