Rule management added.
[platform/core/security/suspicious-activity-monitor.git] / daemon / application_service.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   application_service.h
20  * @brief  Class for software installation and maintenance
21  * @date   Created Jul 28, 2017
22  * @author Mail to: <A HREF="mailto:i.metelytsia@samsung.com">Iurii Metelytsia, i.metelytsia@samsung.com</A>
23  */
24
25 #ifndef __APPLICATION_SERVICE_H__
26 #define __APPLICATION_SERVICE_H__
27
28 #include <string>
29
30 namespace agent
31 {
32
33 /**
34  * @brief The ApplicationService class is designed to install and maintain software
35  */
36 class ApplicationService
37 {
38 public:
39
40     /**
41      * @brief Install package
42      * @details This API can be used to install RPM package
43      * @param package_path_name [in] RPM package full pathname
44      * @return 0 if success
45      */
46     static int install(const std::string& package_path_name);
47
48     /**
49      * @brief Uninstall package
50      * @details This API can be used to uninstall RPM package
51      * @param package_name [in] RPM package name
52      * @return 0 if success
53      */
54     static int uninstall(const std::string& package_name);
55
56     /**
57      * @brief Find process id by application name
58      * @details This API can be used to find out process id
59      * @param name [in] application name
60      * @return process id or -1
61      */
62     static int get_process_id_by_name(const std::string& name);
63
64     /**
65      * @brief Power off the device
66      * @details This API can be used to power off the device
67      * @return 0 if success
68      */
69     static int device_power_off();
70 };
71
72 } // namespace agent
73
74 #endif /* __APPLICATION_SERVICE_H__ */