client-cpp  0.10.0
IKaaClient.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 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 
20 #include <future>
21 
24 #include "kaa/notification/gen/NotificationDefinitions.hpp"
27 #include "kaa/configuration/gen/ConfigurationDefinitions.hpp"
36 #include "kaa/log/RecordFuture.hpp"
38 
39 
40 namespace kaa {
41 
42 class EventFamilyFactory;
43 class IKaaChannelManager;
44 class IKaaDataMultiplexer;
45 class IKaaDataDemultiplexer;
46 class IConfigurationReceiver;
47 class KeyPair;
48 
57 class IKaaClient {
58 public:
62  virtual void start() = 0;
63 
67  virtual void stop() = 0;
68 
72  virtual void pause() = 0;
73 
77  virtual void resume() = 0;
78 
86  virtual void setProfileContainer(IProfileContainerPtr container) = 0;
87 
91  virtual void updateProfile() = 0;
92 
99  virtual EventFamilyFactory& getEventFamilyFactory() = 0;
100 
108  virtual void addTopicListListener(INotificationTopicListListener& listener) = 0;
109 
117  virtual void removeTopicListListener(INotificationTopicListListener& listener) = 0;
118 
125  virtual Topics getTopics() = 0;
126 
134  virtual void addNotificationListener(INotificationListener& listener) = 0;
135 
148  virtual void addNotificationListener(std::int64_t topicId, INotificationListener& listener) = 0;
149 
157  virtual void removeNotificationListener(INotificationListener& listener) = 0;
158 
171  virtual void removeNotificationListener(std::int64_t topicId, INotificationListener& listener) = 0;
172 
188  virtual void subscribeToTopic(std::int64_t id, bool forceSync = true) = 0;
189 
205  virtual void subscribeToTopics(const std::list<std::int64_t>& idList, bool forceSync = true) = 0;
206 
222  virtual void unsubscribeFromTopic(std::int64_t id, bool forceSync = true) = 0;
223 
239  virtual void unsubscribeFromTopics(const std::list<std::int64_t>& idList, bool forceSync = true) = 0;
240 
256  virtual void syncTopicSubscriptions() = 0;
257 
263  virtual void addConfigurationListener(IConfigurationReceiver &receiver) = 0;
264 
270  virtual void removeConfigurationListener(IConfigurationReceiver &receiver) = 0;
276  virtual const KaaRootConfiguration& getConfiguration() = 0;
277 
285  virtual void setConfigurationStorage(IConfigurationStoragePtr storage) = 0;
286 
297  virtual void attachEndpoint(const std::string& endpointAccessToken
299 
310  virtual void detachEndpoint(const std::string& endpointKeyHash
312 
328  virtual void attachUser(const std::string& userExternalId, const std::string& userAccessToken
330 
331  virtual void attachUser(const std::string& userExternalId, const std::string& userAccessToken
332  , const std::string& userVerifierToken, IUserAttachCallbackPtr listener = IUserAttachCallbackPtr()) = 0;
333 
339  virtual void setAttachStatusListener(IAttachStatusListenerPtr listener) = 0;
340 
346  virtual bool isAttachedToUser() = 0;
347 
358  virtual std::int32_t findEventListeners(const std::list<std::string>& eventFQNs, IFetchEventListenersPtr listener) = 0;
359 
371  virtual RecordFuture addLogRecord(const KaaUserLogRecord& record) = 0;
372 
378  virtual void setLogDeliveryListener(ILogDeliveryListenerPtr listener) = 0;
379 
389  virtual void setLogStorage(ILogStoragePtr storage) = 0;
390 
400  virtual void setLogUploadStrategy(ILogUploadStrategyPtr strategy) = 0;
401 
402 
403  virtual void setFailoverStrategy(IFailoverStrategyPtr strategy) = 0;
404 
408  virtual IKaaChannelManager& getChannelManager() = 0;
409 
421  virtual const KeyPair& getClientKeyPair() = 0;
422 
429  virtual void setEndpointAccessToken(const std::string& token) = 0;
430 
437  virtual std::string refreshEndpointAccessToken() = 0;
438 
444  virtual std::string getEndpointAccessToken() const = 0;
445 
451  virtual std::string getEndpointKeyHash() const = 0;
452 
459 
466 
473 
480 
486  virtual IKaaClientContext& getKaaClientContext() = 0;
487 
488  virtual ~IKaaClient() { }
489 };
490 
491 }
492 
493 
494 #endif /* IKAACLIENT_HPP_ */
The listener which receives updates on available topics.
virtual void setProfileContainer(IProfileContainerPtr container)=0
Sets profile container implemented by the user.
virtual std::string getEndpointAccessToken() const =0
Retrieve an access token for a current endpoint.
std::shared_ptr< ILogDeliveryListener > ILogDeliveryListenerPtr
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 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...
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 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 setLogDeliveryListener(ILogDeliveryListenerPtr listener)=0
Set a listener which receives a delivery status of each log bucket.
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
Definition: ILogStorage.hpp:93
virtual void setAttachStatusListener(IAttachStatusListenerPtr listener)=0
Sets listener to notify of the current endpoint is attached/detached by another one.
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 RecordFuture addLogRecord(const KaaUserLogRecord &record)=0
Adds a new log record to the log storage.
virtual IKaaClientContext & getKaaClientContext()=0
Retrieves Kaa context data.
std::shared_ptr< IUserAttachCallback > IUserAttachCallbackPtr
virtual void unsubscribeFromTopic(std::int64_t id, bool forceSync=true)=0
Unsubscribes from the specified optional topic to stop receiving notifications on that topic...
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 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 topi...
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:488
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.
virtual std::string getEndpointKeyHash() const =0
std::shared_ptr< IFetchEventListeners > IFetchEventListenersPtr
std::shared_ptr< ILogUploadStrategy > ILogUploadStrategyPtr
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 subscribeToTopic(std::int64_t id, bool forceSync=true)=0
Subscribes to the specified optional topic to receive notifications on that topic.
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