Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | List of all members
AI_IPC::IIpcService Class Referenceabstract

IPC service that enables us to invoke remote method and emit signals as well as to handle incoming method calls and received signals. More...

#include <IIpcService.h>

Inheritance diagram for AI_IPC::IIpcService:
Inheritance graph
[legend]

Public Member Functions

virtual bool isValid () const =0
 Returns true if we initialised ourselves successfully. More...
 
virtual std::shared_ptr< IAsyncReplyGetterinvokeMethod (const Method &method, const VariantList &args, int timeoutMs=-1)=0
 Invoke a method and get reply asynchronously. More...
 
virtual bool invokeMethod (const Method &method, const VariantList &args, VariantList &replyArgs, int timeoutMs=-1)=0
 Invoke a method and get reply synchronously. More...
 
virtual bool emitSignal (const Signal &signal, const VariantList &args)=0
 Emit a signal. More...
 
virtual std::string registerMethodHandler (const Method &method, const MethodHandler &handler)=0
 Register a method handler. More...
 
virtual std::string registerSignalHandler (const Signal &signal, const SignalHandler &handler)=0
 Register a signal handler. More...
 
virtual bool unregisterHandler (const std::string &regId)=0
 Unregister a method or signal handler. More...
 
virtual bool enableMonitor (const std::set< std::string > &matchRules, const MonitorHandler &handler)=0
 Enables monitor mode for the service. More...
 
virtual bool disableMonitor ()=0
 Disables monitor mode for the service. More...
 
virtual bool isServiceAvailable (const std::string &serviceName) const =0
 Checks if the given service name is currently registered on the bus. More...
 
virtual void flush ()=0
 Flushes all messages out. More...
 
virtual bool start ()=0
 Start IPC service. More...
 
virtual bool stop ()=0
 Stop IPC service. More...
 
virtual std::string getBusAddress () const =0
 Returns the dbus address the service is using. More...
 

Detailed Description

IPC service that enables us to invoke remote method and emit signals as well as to handle incoming method calls and received signals.

Member Function Documentation

◆ disableMonitor()

virtual bool AI_IPC::IIpcService::disableMonitor ( )
pure virtual

Disables monitor mode for the service.

Returns
On success: True.
On failure: False.

Implemented in SDBusIpcService, and IpcService.

◆ emitSignal()

virtual bool AI_IPC::IIpcService::emitSignal ( const Signal signal,
const VariantList &  args 
)
pure virtual

Emit a signal.

@parameter[in] signal Signal definition @parameter[in] args Signal arguments/data

Returns
On success: True.
On failure: False.

Implemented in SDBusIpcService, and IpcService.

◆ enableMonitor()

virtual bool AI_IPC::IIpcService::enableMonitor ( const std::set< std::string > &  matchRules,
const MonitorHandler &  handler 
)
pure virtual

Enables monitor mode for the service.

@parameter[in] matchRules Optional set of match rules for monitor mode, can be empty @parameter[in] handler Handler callback for all events received in monitor mode

Returns
On success: True.
On failure: False.

Implemented in SDBusIpcService, and IpcService.

◆ flush()

virtual void AI_IPC::IIpcService::flush ( )
pure virtual

Flushes all messages out.

This method ensures that any message or signal handlers queued before this function was called are processed before the function returns.

For obvious reasons do not hold any lock that a handler might need while calling this function.

Implemented in SDBusIpcService, and IpcService.

◆ getBusAddress()

virtual std::string AI_IPC::IIpcService::getBusAddress ( ) const
pure virtual

Returns the dbus address the service is using.

Note the address is formatted like a dbus address and is NOT just the path to the unix socket.

Returns
The dbus address.

Implemented in SDBusIpcService, and IpcService.

◆ invokeMethod() [1/2]

virtual std::shared_ptr<IAsyncReplyGetter> AI_IPC::IIpcService::invokeMethod ( const Method method,
const VariantList &  args,
int  timeoutMs = -1 
)
pure virtual

Invoke a method and get reply asynchronously.

@parameter[in] method Method definition @parameter[in] args Method arguments @parameter[in] timeoutMs Timeout in milliseconds, -1 for default (30 seconds)

Returns
On success: Shared pointer pointing to a reply getter to receive reply asynchronously.
On failure: Empty shared pointer.

Implemented in IpcService, and SDBusIpcService.

◆ invokeMethod() [2/2]

virtual bool AI_IPC::IIpcService::invokeMethod ( const Method method,
const VariantList &  args,
VariantList &  replyArgs,
int  timeoutMs = -1 
)
pure virtual

Invoke a method and get reply synchronously.

@parameter[in] method Method definition @parameter[in] args Method arguments @parameter[in] replyArgs Reply return by the method call @parameter[in] timeoutMs Timeout in milliseconds, -1 for default (30 seconds)

Returns
On success: True.
On failure: False.

Implemented in IpcService, and SDBusIpcService.

◆ isServiceAvailable()

virtual bool AI_IPC::IIpcService::isServiceAvailable ( const std::string &  serviceName) const
pure virtual

Checks if the given service name is currently registered on the bus.

@parameter[in] serviceName The name of the service to look for

Returns
On success: True.
On failure: False.

Implemented in SDBusIpcService, and IpcService.

◆ isValid()

virtual bool AI_IPC::IIpcService::isValid ( ) const
pure virtual

Returns true if we initialised ourselves successfully.

Returns
True if the service was initialised successfully. False if we failed to initialise

Implemented in SDBusIpcService, and IpcService.

◆ registerMethodHandler()

virtual std::string AI_IPC::IIpcService::registerMethodHandler ( const Method method,
const MethodHandler &  handler 
)
pure virtual

Register a method handler.

@parameter[in] method Method definition @parameter[in] handler Method handler

Returns
On success: Registration ID.
On failure: Empty string.

Implemented in SDBusIpcService, and IpcService.

◆ registerSignalHandler()

virtual std::string AI_IPC::IIpcService::registerSignalHandler ( const Signal signal,
const SignalHandler &  handler 
)
pure virtual

Register a signal handler.

@parameter[in] method Signal definition @parameter[in] handler Signal handler

Returns
On success: Registration ID.
On failure: Empty string.

Implemented in SDBusIpcService, and IpcService.

◆ start()

virtual bool AI_IPC::IIpcService::start ( )
pure virtual

Start IPC service.

It needs to be invoked to start the event dispatcher, which is required to handle method and signals, as well as to get method call reply.

Returns
On success: True.
On failure: False.

Implemented in SDBusIpcService, and IpcService.

◆ stop()

virtual bool AI_IPC::IIpcService::stop ( )
pure virtual

Stop IPC service.

The event dispatcher thread will be terminated.

Returns
On success: True.
On failure: False.

Implemented in SDBusIpcService, and IpcService.

◆ unregisterHandler()

virtual bool AI_IPC::IIpcService::unregisterHandler ( const std::string &  regId)
pure virtual

Unregister a method or signal handler.

@parameter[in] regId Registration Id

Returns
On success: True.
On failure: False.

Implemented in SDBusIpcService, and IpcService.


The documentation for this class was generated from the following file: