tizen 2.3 release
[framework/web/wearable/wrt-security.git] / src / services / ace / dbus / ace_server_dbus_interface.h
1 /*
2  * Copyright (c) 2011 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        ace_service_dbus_interface.h
18  * @author      Tomasz Swierczek (t.swierczek@samsung.com)
19  * @version     1.0
20  * @brief       Class that handles ACE server API.
21  */
22 #ifndef WRT_SRC_RPC_SECURITY_DAEMON_ACE_SERVER_DBUS_INTERFACE_H_
23 #define WRT_SRC_RPC_SECURITY_DAEMON_ACE_SERVER_DBUS_INTERFACE_H_
24
25 #include <dpl/dbus/dbus_interface_dispatcher.h>
26 #include "api/ace_server_dbus_api.h"
27
28 namespace RPC {
29
30 class AceServerDBusInterface : public DPL::DBus::InterfaceDispatcher {
31   public:
32     AceServerDBusInterface():
33         DPL::DBus::InterfaceDispatcher(WrtSecurity::AceServerApi::INTERFACE_NAME())
34     {
35         using namespace WrtSecurity;
36
37         setXmlSignature("<node>"
38             "  <interface name='" + AceServerApi::INTERFACE_NAME() + "'>"
39             "    <method name='" + AceServerApi::ECHO_METHOD() + "'>"
40             "      <arg type='s' name='input' direction='in'/>"
41             "      <arg type='s' name='output' direction='out'/>"
42             "    </method>"
43             "    <method name='" + AceServerApi::CHECK_ACCESS_METHOD() + "'>"
44             "      <arg type='i' name='handle' direction='in'/>"
45             "      <arg type='s' name='subject' direction='in'/>"
46             "      <arg type='s' name='resource' direction='in'/>"
47             "      <arg type='as' name='parameter names' direction='in'/>"
48             "      <arg type='as' name='parameter values' direction='in'/>"
49             "      <arg type='s' name='session' direction='in'/>"
50             "      <arg type='i' name='output' direction='out'/>"
51             "    </method>"
52             "    <method name='" + AceServerApi::CHECK_ACCESS_INSTALL_METHOD() + "'>"
53             "      <arg type='i' name='handle' direction='in'/>"
54             "      <arg type='s' name='resource' direction='in'/>"
55             "      <arg type='i' name='output' direction='out'/>"
56             "    </method>"
57             "    <method name='" + AceServerApi::UPDATE_POLICY_METHOD() + "'>"
58             "    </method>"
59             "  </interface>"
60             "</node>");
61     }
62
63     virtual ~AceServerDBusInterface()
64     {}
65
66     virtual void onMethodCall(const gchar* methodName,
67                               GVariant* parameters,
68                               GDBusMethodInvocation* invocation);
69 };
70
71 } // namespace RPC
72
73 #endif // WRT_SRC_RPC_SECURITY_DAEMON_ACE_SERVER_DBUS_INTERFACE_H_