Add cloud provisioning feature & modify mediator C++ class in easy setup
[platform/upstream/iotivity.git] / service / easy-setup / mediator / richsdk / inc / EasySetup.h
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics 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 EASYSETUP_H_
22 #define EASYSETUP_H_
23
24 #include <memory>
25 #include <vector>
26
27 #include "ESRichCommon.h"
28 #include "RemoteEnrollee.h"
29
30 namespace OIC
31 {
32     namespace Service
33     {
34         class RemoteEnrollee;
35
36         /**
37          * This provides methods for Mediator devices to perform EasySetup of Enrollee devices.
38          * EasySetup involves
39          * 1) Ownership transfer for enabling secured communication between Mediator and Enrollee
40          * devices.
41          * 2) Provisioning of Enrollee devices using the credentails of target Enroller devices.
42          */
43         class EasySetup
44         {
45         public:
46             /**
47              * API for getting the instance of EasySetup singleton class.
48              * @return EasySetup instance.
49              */
50             static EasySetup* getInstance();
51
52             /**
53              * This API is used for creating a remote Enrollee  instance.
54              *
55              * @throws ESBadRequestException If createEnrolleeDevice is invoked with the same
56              *         provisioning information.
57              *
58              * @return Pointer to RemoteEnrollee instance.
59              */
60             std::shared_ptr<RemoteEnrollee> createRemoteEnrollee();
61
62         private:
63             EasySetup();
64             ~EasySetup();
65
66             static EasySetup *s_instance;
67         };
68     }
69 }
70
71 #endif /* EASYSETUP_H_ */