ba964b05c4fac9144b51855f6485c9b032bdb6fc
[platform/core/security/suspicious-activity-monitor.git] / communication / inc / restservice.h
1 /**
2  * Samsung Ukraine R&D Center (SRK under a contract between)
3  * LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
4  * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License
17  */
18 /**
19  * @file   restservice.h
20  * @brief  Service to provide data exchange between security server and control application
21  * @date   Created Jul 11, 2017
22  * @author Mail to: <A HREF="mailto:d.lomtev@samsung.com">Dmytro Lomtev, d.lomtev@samsung.com</A>
23  */
24
25 #ifndef RESTSERVICE_H
26 #define RESTSERVICE_H
27
28 #include "irestservice.h"
29
30 namespace communication
31 {
32
33 /**
34  * @brief REST interface to DSM server
35  */
36 class RestService: public IRestService
37 {
38 public:
39     /**
40      * @brief Constructor
41      * @param server_address DSM server host address
42      */
43     RestService(const std::string& server_address);
44
45     ~RestService();
46
47     std::string getUpdates(const SessionInfo& info) override;
48
49     std::string registerDevice(const SessionInfo& info, const Json::Value& data) override;
50
51     std::string auth(const SessionInfo& info, const std::string& secret) override;
52
53     std::string doGet(const SessionInfo& info, const std::string& uri) override;
54
55     void doPost(const SessionInfo& info, const std::string& uri, const std::string& data) override;
56
57     void sendData(const SessionInfo& info, const std::string& data) override;
58
59     void sendData(const SessionInfo& info, const Json::Value& data) override;
60 private:
61     std::string host;
62 };
63
64 }
65
66 #endif // RESTSERVICE_H