1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef LITESESSION_HPP_
22 #define LITESESSION_HPP_
24 // ============================================================================
26 // ============================================================================
30 #include <boost/shared_ptr.hpp>
32 using namespace Intel::STC;
34 #include "LiteConnection.h"
36 // ============================================================================
38 // ============================================================================
45 LiteSession(API::Context::SharedPtr pCCFContext, UUID_t uuid) : pCCFContext_(pCCFContext), sessionId_(uuid) {};
46 virtual ~LiteSession() { connectionSet_.clear(); };
48 virtual void invite() = 0;
49 virtual void disconnect() = 0;
60 void setPublicAvatarId(const UUID_t& avatarId) {
61 publicAvatarId_ = avatarId;
64 void setPrivateAvatarId(const UUID_t& avatarId) {
65 privateAvatarId_ = avatarId;
68 void setUserId(const UUID_t& userId) {
72 void setIssuer(const std::string& issuer) {
76 void setName(const std::string& name) {
80 void setStatusText(const std::string& text) {
84 void setSecurityCode(const std::string& code) {
88 void setApplicationSet(const std::set<UUID_t>& applicationSet) {
89 applicationSet_ = applicationSet;
92 const UUID_t& getPublicAvatarId() {
93 return publicAvatarId_;
96 const UUID_t& getPrivateAvatarId() {
97 return privateAvatarId_;
100 const UUID_t& getUserId() {
104 const std::string& getIssuer() {
108 const std::string& getName() {
112 const std::string& getStatusText() {
116 const std::string& getSecurityCode() {
117 return securityCode_;
119 const std::set<UUID_t>& getApplicationSet() {
120 return applicationSet_;
123 void addConnection(boost::shared_ptr<LiteConnection> connection) {
124 connectionSet_.insert(connection);
127 void removeConnection(boost::shared_ptr<LiteConnection> connection) {
128 connectionSet_.erase(connection);
132 bool onLocalNetwork_;
133 bool onCloudNetwork_;
138 API::Context::SharedPtr pCCFContext_;
139 API::InvitationBuilder::SharedPtr pInvitationBuilder_;
142 UUID_t publicAvatarId_;
143 UUID_t privateAvatarId_;
146 std::string sessionName_;
147 std::string statusText_;
148 std::string securityCode_;
149 std::set <UUID_t> applicationSet_;
151 std::set<boost::shared_ptr<LiteConnection>> connectionSet_;
159 #endif /* LITESESSION_HPP_ */