client-cpp  0.7.0
IKaaClient.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2015 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef IKAACLIENT_HPP_
18 #define IKAACLIENT_HPP_
19 
22 #include "kaa/notification/gen/NotificationDefinitions.hpp"
25 #include "kaa/configuration/gen/ConfigurationDefinitions.hpp"
32 
33 
34 namespace kaa {
35 
36 class EventFamilyFactory;;
37 class IKaaChannelManager;
38 class IKaaDataMultiplexer;
39 class IKaaDataDemultiplexer;
40 class IConfigurationReceiver;
41 class KeyPair;
42 
51 class IKaaClient {
52 public:
53 
61  virtual void setProfileContainer(IProfileContainerPtr container) = 0;
62 
66  virtual void updateProfile() = 0;
67 
74  virtual EventFamilyFactory& getEventFamilyFactory() = 0;
75 
83  virtual void addTopicListListener(INotificationTopicListListener& listener) = 0;
84 
92  virtual void removeTopicListListener(INotificationTopicListListener& listener) = 0;
93 
100  virtual Topics getTopics() = 0;
101 
109  virtual void addNotificationListener(INotificationListener& listener) = 0;
110 
123  virtual void addNotificationListener(const std::string& topidId, INotificationListener& listener) = 0;
124 
132  virtual void removeNotificationListener(INotificationListener& listener) = 0;
133 
146  virtual void removeNotificationListener(const std::string& topidId, INotificationListener& listener) = 0;
147 
163  virtual void subscribeToTopic(const std::string& id, bool forceSync = true) = 0;
164 
180  virtual void subscribeToTopics(const std::list<std::string>& idList, bool forceSync = true) = 0;
181 
197  virtual void unsubscribeFromTopic(const std::string& id, bool forceSync = true) = 0;
198 
214  virtual void unsubscribeFromTopics(const std::list<std::string>& idList, bool forceSync = true) = 0;
215 
231  virtual void syncTopicSubscriptions() = 0;
232 
238  virtual void addConfigurationListener(IConfigurationReceiver &receiver) = 0;
239 
245  virtual void removeConfigurationListener(IConfigurationReceiver &receiver) = 0;
251  virtual const KaaRootConfiguration& getConfiguration() = 0;
252 
260  virtual void setConfigurationStorage(IConfigurationStoragePtr storage) = 0;
261 
272  virtual void attachEndpoint(const std::string& endpointAccessToken
274 
285  virtual void detachEndpoint(const std::string& endpointKeyHash
287 
303  virtual void attachUser(const std::string& userExternalId, const std::string& userAccessToken
305 
306  virtual void attachUser(const std::string& userExternalId, const std::string& userAccessToken
307  , const std::string& userVerifierToken, IUserAttachCallbackPtr listener = IUserAttachCallbackPtr()) = 0;
308 
314  virtual void setAttachStatusListener(IAttachStatusListenerPtr listener) = 0;
320  virtual bool isAttachedToUser() = 0;
321 
332  virtual std::int32_t findEventListeners(const std::list<std::string>& eventFQNs, IFetchEventListenersPtr listener) = 0;
333 
345  virtual void addLogRecord(const KaaUserLogRecord& record) = 0;
346 
356  virtual void setLogStorage(ILogStoragePtr storage) = 0;
357 
367  virtual void setLogUploadStrategy(ILogUploadStrategyPtr strategy) = 0;
368 
372  virtual IKaaChannelManager& getChannelManager() = 0;
373 
385  virtual const KeyPair& getClientKeyPair() = 0;
386 
393  virtual void setEndpointAccessToken(const std::string& token) = 0;
394 
401  virtual std::string refreshEndpointAccessToken() = 0;
402 
408  virtual std::string getEndpointAccessToken() = 0;
409 
416 
423 
430 
437 
438  virtual ~IKaaClient() { }
439 };
440 
441 }
442 
443 
444 #endif /* IKAACLIENT_HPP_ */
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 topi...
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...
The listener which receives updates on available topics.
virtual void setProfileContainer(IProfileContainerPtr container)=0
virtual void updateProfile()=0
virtual void removeConfigurationListener(IConfigurationReceiver &receiver)=0
virtual void setConfigurationStorage(IConfigurationStoragePtr storage)=0
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 defa...
virtual std::string refreshEndpointAccessToken()=0
Generate new access token for a current endpoint.
virtual IKaaChannelManager & getChannelManager()=0
Retrieves the Channel Manager.
virtual IKaaDataMultiplexer & getBootstrapMultiplexer()=0
Retrieves Kaa bootstrap data multiplexer.
virtual void setEndpointAccessToken(const std::string &token)=0
Set new access token for a current endpoint.
std::shared_ptr< IDetachEndpointCallback > IDetachEndpointCallbackPtr
virtual void addLogRecord(const KaaUserLogRecord &record)=0
Adds a new log record to the log storage.
virtual void setLogUploadStrategy(ILogUploadStrategyPtr strategy)=0
Sets the new log upload strategy.
virtual IKaaDataDemultiplexer & getBootstrapDemultiplexer()=0
Retrieves Kaa bootstrap data demultiplexer.
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.
virtual void syncTopicSubscriptions()=0
Sends subscription request(s) to the Operations server.
virtual EventFamilyFactory & getEventFamilyFactory()=0
std::shared_ptr< IProfileContainer > IProfileContainerPtr
virtual const KeyPair & getClientKeyPair()=0
Retrieves the client's public and private key.
std::shared_ptr< ILogStorage > ILogStoragePtr
virtual void setAttachStatusListener(IAttachStatusListenerPtr listener)=0
Sets listener to notify of the current endpoint is attached/detached by another one.
virtual std::string getEndpointAccessToken()=0
Retrieve an access token for a current endpoint.
The listener which receives notifications on the specified topic.
virtual Topics getTopics()=0
Retrieves the list of available topics.
std::shared_ptr< IConfigurationStorage > IConfigurationStoragePtr
virtual void addNotificationListener(INotificationListener &listener)=0
Adds the listener which receives notifications on all available topics.
std::shared_ptr< IAttachStatusListener > IAttachStatusListenerPtr
virtual void unsubscribeFromTopic(const std::string &id, bool forceSync=true)=0
Unsubscribes from the specified optional topic to stop receiving notifications on that topic...
std::shared_ptr< IUserAttachCallback > IUserAttachCallbackPtr
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.
virtual void addConfigurationListener(IConfigurationReceiver &receiver)=0
NOTE: THIS FILE IS AUTO-GENERATED. DO NOT EDIT IT MANUALLY.
virtual void addTopicListListener(INotificationTopicListListener &listener)=0
Adds the listener which receives updates on the list of available topics.
virtual ~IKaaClient()
Definition: IKaaClient.hpp:438
virtual IKaaDataDemultiplexer & getOperationDemultiplexer()=0
Retrieves Kaa operations data demultiplexer.
virtual void removeNotificationListener(INotificationListener &listener)=0
Removes the listener which receives notifications on all available topics.
std::shared_ptr< IFetchEventListeners > IFetchEventListenersPtr
std::shared_ptr< ILogUploadStrategy > ILogUploadStrategyPtr
virtual void subscribeToTopic(const std::string &id, bool forceSync=true)=0
Subscribes to the specified optional topic to receive notifications on that topic.
virtual void removeTopicListListener(INotificationTopicListListener &listener)=0
Removes listener which receives updates on the list of available topics.
virtual std::int32_t findEventListeners(const std::list< std::string > &eventFQNs, IFetchEventListenersPtr listener)=0
Submits an event listeners resolution request.
virtual bool isAttachedToUser()=0
Checks if the current endpoint is already attached to some user.
virtual void setLogStorage(ILogStoragePtr storage)=0
Sets the new log storage.
std::shared_ptr< IAttachEndpointCallback > IAttachEndpointCallbackPtr
virtual IKaaDataMultiplexer & getOperationMultiplexer()=0
Retrieves Kaa operations data multiplexer.
virtual const KaaRootConfiguration & getConfiguration()=0