client-cpp  0.6.1
IEndpointRegistrationManager.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License") = 0;
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 IENDPOINTREGISTRATIONMANAGER_HPP_
18 #define IENDPOINTREGISTRATIONMANAGER_HPP_
19 
20 #include "kaa/KaaDefaults.hpp"
21 
22 #ifdef KAA_USE_EVENTS
23 
24 #include <list>
25 #include <string>
26 
27 namespace kaa {
28 
29 typedef std::map<std::string/*epToken*/, std::string/*epHash*/> AttachedEndpoints;
30 
31 class IAttachedEndpointListListener;
32 class IEndpointAttachStatusListener;
33 
37 class IEndpointRegistrationManager
38 {
39 public:
43  virtual void regenerateEndpointAccessToken() = 0;
44 
48  virtual const std::string& getEndpointAccessToken() = 0;
49 
57  virtual void attachEndpoint(const std::string& endpointAccessToken
58  , IEndpointAttachStatusListener* listener = nullptr) = 0;
59 
67  virtual void detachEndpoint(const std::string& endpointKeyHash
68  , IEndpointAttachStatusListener* listener = nullptr) = 0;
69 
75  virtual void detachEndpoint(IEndpointAttachStatusListener* listener = nullptr) = 0;
76 
85  virtual void attachUser(const std::string& userExternalId
86  , const std::string& userAccessToken
87  , IEndpointAttachStatusListener* listener = nullptr) = 0;
88 
94  virtual const AttachedEndpoints& getAttachedEndpoints() = 0;
95 
101  virtual void addAttachedEndpointListListener(IAttachedEndpointListListener *listener) = 0;
102 
108  virtual void removeAttachedEndpointListListener(IAttachedEndpointListListener *listener) = 0;
109 
113  virtual bool isCurrentEndpointAttached() = 0;
114 
121  virtual void setAttachStatusListener(IEndpointAttachStatusListener* listener) = 0;
122 
123  virtual ~IEndpointRegistrationManager() {}
124 };
125 
126 }
127 
128 #endif
129 
130 #endif /* IENDPOINTREGISTRATIONMANAGER_HPP_ */
std::map< std::string, std::string > AttachedEndpoints