client-cpp  0.7.4
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"
33 
34 
35 namespace kaa {
36 
37 class EventFamilyFactory;;
38 class IKaaChannelManager;
39 class IKaaDataMultiplexer;
40 class IKaaDataDemultiplexer;
41 class IConfigurationReceiver;
42 class KeyPair;
43 
52 class IKaaClient {
53 public:
57  virtual void start() = 0;
58 
62  virtual void stop() = 0;
63 
67  virtual void pause() = 0;
68 
72  virtual void resume() = 0;
73 
81  virtual void setProfileContainer(IProfileContainerPtr container) = 0;
82 
86  virtual void updateProfile() = 0;
87 
94  virtual EventFamilyFactory& getEventFamilyFactory() = 0;
95 
103  virtual void addTopicListListener(INotificationTopicListListener& listener) = 0;
104 
112  virtual void removeTopicListListener(INotificationTopicListListener& listener) = 0;
113 
120  virtual Topics getTopics() = 0;
121 
129  virtual void addNotificationListener(INotificationListener& listener) = 0;
130 
143  virtual void addNotificationListener(const std::string& topidId, INotificationListener& listener) = 0;
144 
152  virtual void removeNotificationListener(INotificationListener& listener) = 0;
153 
166  virtual void removeNotificationListener(const std::string& topidId, INotificationListener& listener) = 0;
167 
183  virtual void subscribeToTopic(const std::string& id, bool forceSync = true) = 0;
184 
200  virtual void subscribeToTopics(const std::list<std::string>& idList, bool forceSync = true) = 0;
201 
217  virtual void unsubscribeFromTopic(const std::string& id, bool forceSync = true) = 0;
218 
234  virtual void unsubscribeFromTopics(const std::list<std::string>& idList, bool forceSync = true) = 0;
235 
251  virtual void syncTopicSubscriptions() = 0;
252 
258  virtual void addConfigurationListener(IConfigurationReceiver &receiver) = 0;
259 
265  virtual void removeConfigurationListener(IConfigurationReceiver &receiver) = 0;
271  virtual const KaaRootConfiguration& getConfiguration() = 0;
272 
280  virtual void setConfigurationStorage(IConfigurationStoragePtr storage) = 0;
281 
292  virtual void attachEndpoint(const std::string& endpointAccessToken
294 
305  virtual void detachEndpoint(const std::string& endpointKeyHash
307 
323  virtual void attachUser(const std::string& userExternalId, const std::string& userAccessToken
325 
326  virtual void attachUser(const std::string& userExternalId, const std::string& userAccessToken
327  , const std::string& userVerifierToken, IUserAttachCallbackPtr listener = IUserAttachCallbackPtr()) = 0;
328 
334  virtual void setAttachStatusListener(IAttachStatusListenerPtr listener) = 0;
340  virtual bool isAttachedToUser() = 0;
341 
352  virtual std::int32_t findEventListeners(const std::list<std::string>& eventFQNs, IFetchEventListenersPtr listener) = 0;
353 
365  virtual void addLogRecord(const KaaUserLogRecord& record) = 0;
366 
376  virtual void setLogStorage(ILogStoragePtr storage) = 0;
377 
387  virtual void setLogUploadStrategy(ILogUploadStrategyPtr strategy) = 0;
388 
389 
390  virtual void setFailoverStrategy(IFailoverStrategyPtr strategy) = 0;
391 
395  virtual IKaaChannelManager& getChannelManager() = 0;
396 
408  virtual const KeyPair& getClientKeyPair() = 0;
409 
416  virtual void setEndpointAccessToken(const std::string& token) = 0;
417 
424  virtual std::string refreshEndpointAccessToken() = 0;
425 
431  virtual std::string getEndpointAccessToken() = 0;
432 
439 
446 
453 
460 
461  virtual ~IKaaClient() { }
462 };
463 
464 }
465 
466 
467 #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
Sets profile container implemented by the user.
std::shared_ptr< IFailoverStrategy > IFailoverStrategyPtr
virtual void updateProfile()=0
Notifies server about profile changes.
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 start()=0
Starts Kaa's workflow.
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.
virtual void pause()=0
Pauses Kaa's workflow.
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.
virtual void resume()=0
Resumes Kaa's workflow.
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 stop()=0
Stops Kaa's workflow.
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:461
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 void setFailoverStrategy(IFailoverStrategyPtr strategy)=0
virtual const KaaRootConfiguration & getConfiguration()=0