Imported Upstream version 1.2.0
[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 using namespace OC;
31 namespace OIC
32 {
33     namespace Service
34     {
35         class RemoteEnrollee;
36
37         /**
38          * This provides an API to instanciate a new RemoteEnrollee object correspondent to Enrollee
39          * Device to be setup.
40          */
41         class EasySetup
42         {
43         public:
44             /**
45              * API for getting the instance of EasySetup singleton class.
46              * @return EasySetup instance.
47              */
48             static EasySetup* getInstance();
49
50             /**
51              * This API is used for creating a remote Enrollee instance.
52              *
53              * @param enrolleeResource an OCResource object corresponding to enrollee resource
54              *        discovered in a network. The OCResource object can be obtained by calling
55              *        OCPlatform.findResource() API. What resource you have to discover with
56              *        the OCPlatform.findResource() API is a "provisioning" resource with a certain
57              *        resource type, i.e. oic.wk.prov
58              *
59              * @throws ESBadRequestException If createEnrolleeDevice is invoked with the same
60              *         provisioning information.
61              *
62              * @return Pointer to RemoteEnrollee instance.
63              */
64             std::shared_ptr<RemoteEnrollee> createRemoteEnrollee(
65                                         std::shared_ptr< OC::OCResource > enrolleeResource);
66
67         private:
68             EasySetup();
69             ~EasySetup();
70
71         private:
72             std::shared_ptr< OC::OCResource > m_ocResource;
73             static EasySetup *s_instance;
74         };
75     }
76 }
77
78 #endif /* EASYSETUP_H_ */