2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Bumjin Im <bj.im@samsung.com>
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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
20 * @author Zbigniew Jasinski (z.jasinski@samsung.com)
22 * @brief Starts, stops or restarts services (e.g. security-server.service)
23 * using dbus interface to communicate with systemd.
25 #ifndef _DBUS_ACCESS_H_
26 #define _DBUS_ACCESS_H_
28 #include <dbus/dbus.h>
29 #include <dbus-glib.h>
30 #include <glib-object.h>
36 DBusAccess() = delete;
37 DBusAccess(const char *service_name);
41 void restartService();
43 virtual ~DBusAccess();
47 void newMethodCall(const char *method);
48 void appendToMsg(const char *argument);
49 void sendMsgWithReply();
51 void handleMsgReply();
54 void sendGetUnitToSystemd(const char *service_name);
55 void sendToService(const char *method);
56 void sendResetFailedToService();
58 DBusConnection *m_conn;
61 DBusPendingCall *m_pending;
63 std::string m_signal_type;
64 std::string m_signal_interface;
65 std::string m_signal_member;
66 std::string m_signal_path;
68 std::string m_signal_match;
70 std::string m_dbus_client_name;
72 std::string m_service_name;
77 #endif // _DBUS_ACCESS_H_