Restore host string behavior lost in IPv6 plumbing patch
[platform/upstream/iotivity.git] / resource / include / IClientWrapper.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef _I_CLIENT_WRAPPER_H_
22 #define _I_CLIENT_WRAPPER_H_
23
24 #include <memory>
25 #include <string>
26
27 #include <OCApi.h>
28
29 namespace OC
30 {
31     class OCPlatform_impl;
32
33     class IClientWrapper : public std::enable_shared_from_this<IClientWrapper>
34     {
35     protected:
36
37     public:
38         typedef std::shared_ptr<IClientWrapper> Ptr;
39
40         IClientWrapper()
41         {}
42
43         virtual OCStackResult ListenForResource(const std::string& serviceUrl,
44                         const std::string& resourceType,
45                         OCConnectivityType connectivityType,
46                         FindCallback& callback,
47                         QualityOfService QoS) = 0;
48
49         virtual OCStackResult ListenForDevice(const std::string& serviceUrl,
50                         const std::string& deviceURI,
51                         OCConnectivityType connectivityType,
52                         FindDeviceCallback& callback,
53                         QualityOfService QoS) = 0;
54
55         virtual OCStackResult GetResourceRepresentation(
56                         const OCDevAddr& devAddr,
57                         bool useHostString,
58                         const std::string& uri,
59                         const QueryParamsMap& queryParams,
60                         const HeaderOptions& headerOptions,
61                         GetCallback& callback, QualityOfService QoS)=0;
62
63         virtual OCStackResult PutResourceRepresentation(
64                         const OCDevAddr& devAddr,
65                         bool useHostString,
66                         const std::string& uri,
67                         const OCRepresentation& rep, const QueryParamsMap& queryParams,
68                         const HeaderOptions& headerOptions,
69                         PutCallback& callback, QualityOfService QoS) = 0;
70
71         virtual OCStackResult PostResourceRepresentation(
72                         const OCDevAddr& devAddr,
73                         bool useHostString,
74                         const std::string& uri,
75                         const OCRepresentation& rep, const QueryParamsMap& queryParams,
76                         const HeaderOptions& headerOptions,
77                         PostCallback& callback, QualityOfService QoS) = 0;
78
79         virtual OCStackResult DeleteResource(
80                         const OCDevAddr& devAddr,
81                         bool useHostString,
82                         const std::string& uri,
83                         const HeaderOptions& headerOptions,
84                         DeleteCallback& callback, QualityOfService QoS) = 0;
85
86         virtual OCStackResult ObserveResource(
87                         ObserveType observeType, OCDoHandle* handle,
88                         const OCDevAddr& devAddr,
89                         bool useHostString,
90                         const std::string& uri,
91                         const QueryParamsMap& queryParams,
92                         const HeaderOptions& headerOptions, ObserveCallback& callback,
93                         QualityOfService QoS)=0;
94
95         virtual OCStackResult CancelObserveResource(
96                         OCDoHandle handle,
97                         const std::string& host,
98                         const std::string& uri,
99                         const HeaderOptions& headerOptions,
100                         QualityOfService QoS)=0;
101
102         virtual OCStackResult SubscribePresence(OCDoHandle* handle,
103                         const std::string& host,
104                         const std::string& resourceType,
105                         OCConnectivityType connectivityType,
106                         SubscribeCallback& presenceHandler)=0;
107
108         virtual OCStackResult UnsubscribePresence(OCDoHandle handle) =0;
109
110         virtual OCStackResult GetDefaultQos(QualityOfService& qos) = 0;
111
112         virtual ~IClientWrapper(){}
113     };
114 }
115
116 #endif
117