Kanzi Connect  3.9.8
Kanzi Connect C++ API
kanzi::connect::ConnectDomain Class Reference

Domain definition for Kanzi Connect. More...

#include <connectdomain.hpp>

Inheritance diagram for kanzi::connect::ConnectDomain:

Public Member Functions

void cancelTimer (int64_t handle)
 Cancel running timer. More...
 
 ConnectDomain ()
 C++ constructor. More...
 
ClientRemoteServiceHostInterfacegetClientRemoteServiceHostInterface () const
 Retrieve remote service host interface. More...
 
ModuleSharedPtr getModule (const string &name)
 Lookup module by name. More...
 
ObjectFactory * getObjectFactory () const
 Retrieve object factory instance. More...
 
PolicyContextInterfacegetPolicyContext ()
 Return the policy context object. More...
 
SecurityContextInterfacegetSecurityContext ()
 Return the security context object. More...
 
ServerConfiggetServerConfig ()
 Get server configuration handler. More...
 
ServerStategetServerState ()
 Get server state handler. More...
 
LocalServiceDiscoveryInterfacegetServiceLookup () const
 Retrieve the interface used to perform service lookup. More...
 
WebSocketContextInterfacegetWebSocketContext ()
 Return the websocket context object. More...
 
bool loadModule (const string &modulename)
 Loads a dynamic module from library. More...
 
template<class _TModuleType >
bool registerModule (const string &name)
 Template method to register a typed module into the system. More...
 
void setClientRemoteServiceHostInterface (ClientRemoteServiceHostInterface &rshInterface)
 Configure remoteservicehost interface. More...
 
void setServiceLookupInterface (LocalServiceDiscoveryInterface *lookupInterface)
 Configure service lookup interface. More...
 
int64_t setTimer (int ms, ConnectWorkItem::Executor executable)
 Schedules an executable object to be run in future. More...
 
void setWorkDispatcher (WorkQueueInterface *dispatcher)
 Configure work item dispatcher to the domain. More...
 
bool unloadModule (const string &modulename)
 Unloads a dynamic module from library. More...
 
 ~ConnectDomain ()
 

Static Public Member Functions

static ConnectDomainSharedPtr create ()
 Creates a default domain instance without configuration file. More...
 
static ConnectDomainSharedPtr create (const string configurationFile)
 Creates an instance of connect domain. More...
 
static ConnectDomainSharedPtr create (FileSet &fileset)
 Creates an instance of connect domain. More...
 
static ConnectDomainSharedPtr createForClient (const string configurationFile=string())
 Creates a reduced connect domain object to be used on client side. More...
 

Detailed Description

Domain definition for Kanzi Connect.

Constructor & Destructor Documentation

◆ ConnectDomain()

kanzi::connect::ConnectDomain::ConnectDomain ( )

C++ constructor.

◆ ~ConnectDomain()

kanzi::connect::ConnectDomain::~ConnectDomain ( )

Member Function Documentation

◆ cancelTimer()

void kanzi::connect::ConnectDomain::cancelTimer ( int64_t  handle)

Cancel running timer.

Parameters
handletimer identifier.

◆ create() [1/3]

static ConnectDomainSharedPtr kanzi::connect::ConnectDomain::create ( )
static

Creates a default domain instance without configuration file.

This creates a stub server without any services or outgoing bearers so not much functional

Returns
newly allocated connect domain

◆ create() [2/3]

static ConnectDomainSharedPtr kanzi::connect::ConnectDomain::create ( const string  configurationFile)
static

Creates an instance of connect domain.

Parameters
configurationFilethe configuration file for server.
Returns
connect domain instance.

◆ create() [3/3]

static ConnectDomainSharedPtr kanzi::connect::ConnectDomain::create ( FileSet fileset)
static

Creates an instance of connect domain.

Parameters
filesetset of configuration files passed during the construction
Returns
connect domain instance.

◆ createForClient()

static ConnectDomainSharedPtr kanzi::connect::ConnectDomain::createForClient ( const string  configurationFile = string())
static

Creates a reduced connect domain object to be used on client side.

Parameters
configurationFileoptional configuration filename to be used to initialize for example policy functionality.
Returns
newly allocation connect domain instance.

◆ getClientRemoteServiceHostInterface()

ClientRemoteServiceHostInterface* kanzi::connect::ConnectDomain::getClientRemoteServiceHostInterface ( ) const

Retrieve remote service host interface.

Returns
pointer to remote service host interface. nullptr if run in context where its not available.

◆ getModule()

ModuleSharedPtr kanzi::connect::ConnectDomain::getModule ( const string &  name)

Lookup module by name.

Parameters
namethe name of the module
Returns
shared pointer to module with the name

◆ getObjectFactory()

ObjectFactory* kanzi::connect::ConnectDomain::getObjectFactory ( ) const

Retrieve object factory instance.

Returns
pointer to object factory. ownership not transfered.

◆ getPolicyContext()

PolicyContextInterface* kanzi::connect::ConnectDomain::getPolicyContext ( )

Return the policy context object.

Returns
pointer to policy context. ownership not transfered.

◆ getSecurityContext()

SecurityContextInterface* kanzi::connect::ConnectDomain::getSecurityContext ( )

Return the security context object.

Returns
pointer to security context. ownership not transfered.

◆ getServerConfig()

ServerConfig* kanzi::connect::ConnectDomain::getServerConfig ( )

Get server configuration handler.

Returns
pointer to server configuration. ownership not transfered.

◆ getServerState()

ServerState* kanzi::connect::ConnectDomain::getServerState ( )

Get server state handler.

Returns
pointer to server state. ownership not transfered.

◆ getServiceLookup()

LocalServiceDiscoveryInterface* kanzi::connect::ConnectDomain::getServiceLookup ( ) const

Retrieve the interface used to perform service lookup.

Returns
pointer to functionality that can be used to discover service within the local system.

◆ getWebSocketContext()

WebSocketContextInterface* kanzi::connect::ConnectDomain::getWebSocketContext ( )

Return the websocket context object.

Returns
pointer to websocket context. ownership not transfered.

◆ loadModule()

bool kanzi::connect::ConnectDomain::loadModule ( const string &  modulename)

Loads a dynamic module from library.

Parameters
modulenamebase for library name. No extension (libXXX.so, .dll) allowed..
Returns
true if successfully loaded, false if some error determined.

◆ registerModule()

template<class _TModuleType >
bool kanzi::connect::ConnectDomain::registerModule ( const string &  name)
inline

Template method to register a typed module into the system.

Parameters
namethe name of the module to register
Returns
true if registration successful, false on error.

◆ setClientRemoteServiceHostInterface()

void kanzi::connect::ConnectDomain::setClientRemoteServiceHostInterface ( ClientRemoteServiceHostInterface rshInterface)

Configure remoteservicehost interface.

Parameters
rshInterfacethe interface to register.

◆ setServiceLookupInterface()

void kanzi::connect::ConnectDomain::setServiceLookupInterface ( LocalServiceDiscoveryInterface lookupInterface)

Configure service lookup interface.

Parameters
lookupInterfacethe service lookup interface.

◆ setTimer()

int64_t kanzi::connect::ConnectDomain::setTimer ( int  ms,
ConnectWorkItem::Executor  executable 
)

Schedules an executable object to be run in future.

Execution conext for the executable is such that it is allowed to use any kanzi connect API's from it.

Parameters
mstimeout after which the executable is launched. Passing <= 0 indicates that object should be executed as soon as possible.
executableexecutable object that is to be invoked.
Returns
handle to timer. This handle is valid (valid if != 0) if timeout is provided and can be used to cancel the object later on.
domain->setTimer(0, [](){ printf("Hey!\n"); });

◆ setWorkDispatcher()

void kanzi::connect::ConnectDomain::setWorkDispatcher ( WorkQueueInterface dispatcher)

Configure work item dispatcher to the domain.

Parameters
dispatcherwork item dispatcher.

◆ unloadModule()

bool kanzi::connect::ConnectDomain::unloadModule ( const string &  modulename)

Unloads a dynamic module from library.

Parameters
modulenamebase for library name. No extension (libXXX.so, .dll) allowed..
Returns
true if successfully unloaded, false if some error determined.

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