Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
IIpcService.h
1 /*
2 * If not stated otherwise in this file or this component's LICENSE file the
3 * following copyright and licenses apply:
4 *
5 * Copyright 2020 Sky UK
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19 /*
20  * IIpcService.h
21  *
22  * Created on: 3 Jun 2015
23  * Author: riyadh
24  */
25 
26 #ifndef AI_IPC_IIPCSERVICE_H
27 #define AI_IPC_IIPCSERVICE_H
28 
29 #include "IpcCommon.h"
30 
31 #include <memory>
32 #include <string>
33 #include <set>
34 
35 namespace AI_IPC
36 {
37 
42 {
43 public:
44  virtual ~IIpcService() = default;
45 
51  virtual bool isValid() const = 0;
52 
63  virtual std::shared_ptr<IAsyncReplyGetter> invokeMethod(const Method& method, const VariantList& args, int timeoutMs = -1) = 0;
64 
76  virtual bool invokeMethod(const Method& method, const VariantList& args, VariantList& replyArgs, int timeoutMs = -1) = 0;
77 
87  virtual bool emitSignal(const Signal& signal, const VariantList& args) = 0;
88 
98  virtual std::string registerMethodHandler(const Method& method, const MethodHandler& handler) = 0;
99 
109  virtual std::string registerSignalHandler(const Signal& signal, const SignalHandler& handler) = 0;
110 
119  virtual bool unregisterHandler(const std::string& regId) = 0;
120 
130  virtual bool enableMonitor(const std::set<std::string>& matchRules, const MonitorHandler& handler) = 0;
131 
138  virtual bool disableMonitor() = 0;
139 
148  virtual bool isServiceAvailable(const std::string& serviceName) const = 0;
149 
158  virtual void flush() = 0;
159 
169  virtual bool start() = 0;
170 
179  virtual bool stop() = 0;
180 
188  virtual std::string getBusAddress() const = 0;
189 };
190 
191 }
192 
193 #endif /* AI_IPC_IIPCSERVICE_H */
194 
IPC service that enables us to invoke remote method and emit signals as well as to handle incoming me...
Definition: IIpcService.h:42
virtual std::string registerMethodHandler(const Method &method, const MethodHandler &handler)=0
Register a method handler.
virtual bool start()=0
Start IPC service.
virtual void flush()=0
Flushes all messages out.
virtual std::string getBusAddress() const =0
Returns the dbus address the service is using.
virtual bool disableMonitor()=0
Disables monitor mode for the service.
virtual bool isServiceAvailable(const std::string &serviceName) const =0
Checks if the given service name is currently registered on the bus.
virtual bool unregisterHandler(const std::string &regId)=0
Unregister a method or signal handler.
virtual bool isValid() const =0
Returns true if we initialised ourselves successfully.
virtual bool enableMonitor(const std::set< std::string > &matchRules, const MonitorHandler &handler)=0
Enables monitor mode for the service.
virtual bool emitSignal(const Signal &signal, const VariantList &args)=0
Emit a signal.
virtual bool stop()=0
Stop IPC service.
virtual bool invokeMethod(const Method &method, const VariantList &args, VariantList &replyArgs, int timeoutMs=-1)=0
Invoke a method and get reply synchronously.
virtual std::string registerSignalHandler(const Signal &signal, const SignalHandler &handler)=0
Register a signal handler.
virtual std::shared_ptr< IAsyncReplyGetter > invokeMethod(const Method &method, const VariantList &args, int timeoutMs=-1)=0
Invoke a method and get reply asynchronously.
Method identified by a service, object, interface and method name itself.
Definition: IpcCommon.h:90
Method identified by object, interface and signal name itself.
Definition: IpcCommon.h:105