eb2b17b1fad56de55f612d1287888e67821ec0db
[platform/core/security/cynara.git] / src / admin / api / ApiInterface.h
1 /*
2  *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License
15  */
16 /*
17  * @file        ApiInterface.h
18  * @author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
19  * @version     1.0
20  * @brief       This file contains libcynara-admin API interface definition.
21  */
22
23 #ifndef SRC_ADMIN_API_APIINTERFACE_H_
24 #define SRC_ADMIN_API_APIINTERFACE_H_
25
26 #include <map>
27 #include <string>
28 #include <vector>
29
30 #include <types/Policy.h>
31 #include <types/PolicyBucketId.h>
32 #include <types/PolicyKey.h>
33 #include <types/PolicyResult.h>
34
35 #include <cynara-admin.h>
36
37 namespace Cynara {
38
39 class ApiInterface {
40 public:
41     ApiInterface() = default;
42     virtual ~ApiInterface() {};
43
44     virtual int setPolicies(const std::map<PolicyBucketId, std::vector<Policy>> &insertOrUpdate,
45                     const std::map<PolicyBucketId, std::vector<PolicyKey>> &remove) noexcept = 0;
46     virtual int insertOrUpdateBucket(const PolicyBucketId &bucket, const PolicyResult &policyResult)
47                     noexcept = 0;
48     virtual int removeBucket(const PolicyBucketId &bucket) noexcept = 0;
49 };
50
51 } // namespace Cynara
52
53 #endif /* SRC_ADMIN_API_APIINTERFACE_H_ */