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 _I_CLIENT_WRAPPER_H_
22 #define _I_CLIENT_WRAPPER_H_
31 class OCPlatform_impl;
33 class IClientWrapper : public std::enable_shared_from_this<IClientWrapper>
38 typedef std::shared_ptr<IClientWrapper> Ptr;
43 virtual OCStackResult ListenForResource(const std::string& serviceUrl,
44 const std::string& resourceType, FindCallback& callback,
45 QualityOfService QoS) = 0;
47 virtual OCStackResult GetResourceRepresentation(const std::string& host,
48 const std::string& uri, const QueryParamsMap& queryParams,
49 const HeaderOptions& headerOptions,
50 GetCallback& callback, QualityOfService QoS)=0;
52 virtual OCStackResult PutResourceRepresentation(const std::string& host,
53 const std::string& uri, const OCRepresentation& rep,
54 const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
55 PutCallback& callback, QualityOfService QoS) = 0;
57 virtual OCStackResult PostResourceRepresentation(const std::string& host,
58 const std::string& uri, const OCRepresentation& rep,
59 const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
60 PostCallback& callback, QualityOfService QoS) = 0;
62 virtual OCStackResult DeleteResource(const std::string& host, const std::string& uri,
63 const HeaderOptions& headerOptions, DeleteCallback& callback,
64 QualityOfService QoS) = 0;
66 virtual OCStackResult ObserveResource(ObserveType observeType, OCDoHandle* handle,
67 const std::string& host, const std::string& uri,
68 const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
69 ObserveCallback& callback, QualityOfService QoS)=0;
71 virtual OCStackResult CancelObserveResource(OCDoHandle handle, const std::string& host,
72 const std::string& uri, const HeaderOptions& headerOptions, QualityOfService QoS)=0;
74 virtual OCStackResult SubscribePresence(OCDoHandle* handle, const std::string& host,
75 const std::string& resourceType, SubscribeCallback& presenceHandler)=0;
77 virtual OCStackResult UnsubscribePresence(OCDoHandle handle) =0;
79 virtual OCStackResult GetDefaultQos(QualityOfService& qos) = 0;
81 virtual ~IClientWrapper(){}