client-cpp  0.10.0
IKaaClientStateStorage.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 ICLIENTSTATESTORAGE_HPP_
18 #define ICLIENTSTATESTORAGE_HPP_
19 
20 #include <cstdint>
21 #include <memory>
22 #include "kaa/gen/EndpointGen.hpp"
24 #include "kaa/notification/gen/NotificationDefinitions.hpp"
25 
26 namespace kaa {
27 
28 typedef struct {
29  std::int32_t eventSequenceNumber;
31 
32 typedef std::map<std::string, std::string> AttachedEndpoints;
33 typedef std::map<std::int64_t, std::int32_t> TopicStates;
34 
36 public:
38 
39  virtual std::int32_t getEventSequenceNumber() const = 0;
40  virtual void setEventSequenceNumber(std::int32_t sequenceNumber) = 0;
41 
42  virtual bool isRegistered() const = 0;
43  virtual void setRegistered(bool isRegistered) = 0;
44 
45  virtual Topics getTopicList() const = 0;
46  virtual void setTopicList(const Topics& stateContainer) = 0;
47 
48  virtual std::int32_t getTopicListHash() = 0;
49  virtual void setTopicListHash(const std::int32_t topicListHash) = 0;
50 
51  virtual HashDigest getProfileHash() const = 0;
52  virtual void setProfileHash(HashDigest hash) = 0;
53 
54  virtual AttachedEndpoints getAttachedEndpoints() const = 0;
55  virtual void setAttachedEndpoints(const AttachedEndpoints& endpoints) = 0;
56 
57  virtual std::string getEndpointAccessToken() = 0;
58  virtual void setEndpointAccessToken(const std::string& token) = 0;
59  virtual std::string refreshEndpointAccessToken() = 0;
60 
61  virtual bool getEndpointAttachStatus() const = 0;
62  virtual void setEndpointAttachStatus(bool isAttached) = 0;
63 
64  virtual std::string getEndpointKeyHash() const = 0;
65  virtual void setEndpointKeyHash(const std::string& keyHash) = 0;
66 
67  virtual bool isSDKPropertiesUpdated() const = 0;
68 
69  virtual TopicStates& getTopicStates() = 0;
70  virtual void setTopicStates(const TopicStates& states) = 0;
71 
72  virtual bool isProfileResyncNeeded() const = 0;
73  virtual void setProfileResyncNeeded(bool isNeeded) = 0;
74 
75  virtual void read() = 0;
76  virtual void save() = 0;
77 };
78 
79 typedef std::shared_ptr<IKaaClientStateStorage> IKaaClientStateStoragePtr;
80 
81 } // namespace kaa
82 
83 
84 #endif /* ICLIENTSTATESTORAGE_HPP_ */
virtual std::int32_t getTopicListHash()=0
virtual HashDigest getProfileHash() const =0
virtual void setEndpointKeyHash(const std::string &keyHash)=0
virtual void setEventSequenceNumber(std::int32_t sequenceNumber)=0
virtual void setProfileHash(HashDigest hash)=0
virtual bool isSDKPropertiesUpdated() const =0
virtual std::string refreshEndpointAccessToken()=0
virtual Topics getTopicList() const =0
virtual void setTopicStates(const TopicStates &states)=0
virtual AttachedEndpoints getAttachedEndpoints() const =0
virtual void setTopicListHash(const std::int32_t topicListHash)=0
virtual bool getEndpointAttachStatus() const =0
virtual TopicStates & getTopicStates()=0
std::map< std::string, std::string > AttachedEndpoints
virtual std::string getEndpointKeyHash() const =0
std::vector< std::uint8_t > HashDigest
std::shared_ptr< IKaaClientStateStorage > IKaaClientStateStoragePtr
virtual void setAttachedEndpoints(const AttachedEndpoints &endpoints)=0
virtual bool isRegistered() const =0
virtual void setRegistered(bool isRegistered)=0
virtual bool isProfileResyncNeeded() const =0
virtual std::string getEndpointAccessToken()=0
virtual void setTopicList(const Topics &stateContainer)=0
virtual void setEndpointAccessToken(const std::string &token)=0
virtual std::int32_t getEventSequenceNumber() const =0
std::map< std::int64_t, std::int32_t > TopicStates
virtual void setEndpointAttachStatus(bool isAttached)=0
virtual void setProfileResyncNeeded(bool isNeeded)=0