Abstract base class for Kanzi Connect services. More...
#include <abstract_service.hpp>
Classes | |
| class | ServiceDescription |
| class | ServiceState |
Public Member Functions | |
| AbstractService () | |
| Constructor. More... | |
| AbstractSessionSharedPtr | acquireSession (int clientId, int sessionId, MessageDispatcher *dispatcher, const string &instanceName) |
| Session factorization method. More... | |
| virtual InvokableOperationResult | addCustomType (const string &xml) |
| Add a custom type to the service. More... | |
| virtual InvokableOperationResult | addCustomTypeDecoded (const string &decodedXml) |
| Add a custom type to the service. More... | |
| virtual int | addEvent (const string &identifier, const string &description) |
| virtual int | addMethod (const string &identifier, const string &description) |
| virtual int | addProperty (const string &identifier, const string &description) |
| virtual InvokableOperationResult | addRoute (const string &xml) |
| Add new P2P route(s) for the service. More... | |
| virtual InvokableOperationResult | addRouteDecoded (const string &decodedXml) |
| Add new P2P route(s) for the service. More... | |
| RuntimeDataSchemaChangeSubscriptionToken | addRuntimeDataSchemaChangeSubscription (RuntimeDataSchemaChangeCallback function) |
| Adds a callback to invoke when runtime data schema changes. More... | |
| StateChangedSubscriptionToken | addStateChangeSubscription (StateCallbackFunction function) |
| Adds a state change callback subscription. More... | |
| bool | addSubscription (const string &identifier, AbstractSessionSharedPtr session) |
| Add subscription to the given session for this service. More... | |
| virtual void | cancelTimer (int64_t timerId) |
| Cancels ongoing timer. More... | |
| int | countSessions () const |
| Amount of allocated sessions. More... | |
| size_t | countSessions () |
| Return the amount of sessions towards this service amount of sessions. More... | |
| virtual InvokableOperationResult | createRuntimedata (const string &parentIdentifier, const string &xml) |
| Create a new runtime data element for the service runtime data. More... | |
| EnumMap::const_iterator | enumerationValuesBegin () |
| EnumMap::const_iterator | enumerationValuesEnd () |
| vector< AbstractSessionSharedPtr > | findSubscribers (const string &identifier) |
| Find all subscribers for the given identifier. More... | |
| const SessionContainer & | getAllSessions () const |
| Returns all currently active sessions. More... | |
| SessionContainer | getAllSessionsOfClient (int clientId) |
| Returns all sessions for a given client. More... | |
| KanziStringVectorSharedPtr | getAttributes () |
| Lists all service attributes. More... | |
| RuntimeDataObjectSharedPtr | getConfigurationProperties () |
| Retrieves configuration properties as a runtime data object to allow more convenient access to data. More... | |
| ContentClientSharedPtr | getContentClient () const |
| Access to content system. More... | |
| virtual ContentProviderCollectionSharedPtr | getContentProvider () |
| Returns content provider for this service. More... | |
| const vector< unique_ptr< CustomType > > & | getCustomTypes () const |
| Get the custom types defined for this service. More... | |
| KanziStringVectorSharedPtr | getDisabledInvokables () |
| ConnectDomain * | getDomain () const |
| Retrieves the connect domain. More... | |
| optional< int > | getEnumValue (const string &name, const string &enumerator) |
| Find out value for enumeration string. More... | |
| ServiceExtensionContainer * | getExtensions () |
| string | getFullyQualifiedConfigurationPropertyName (const string &name) |
| Constructs a fully qualified configuration property name, usually the fully qualified name is something like "Connect.Service.MyService.ConfigurationProperties.MyPropertyName". More... | |
| virtual GenericInvoker * | getGenericInvoker () |
| Retrieve a generic invoker bound to this service. More... | |
| virtual string | getIdentifier () const =0 |
| InterfaceDomainBase * | getInterfaceDomain () const |
| Access to interface domain. More... | |
| virtual RuntimeDataObjectSharedPtr | getModifiedConfigurationProperties () |
| Retrieves modified configuration properties as runtime data object. More... | |
| virtual string | getName () |
| Returns the override name. More... | |
| WorkQueueInterface * | getProxyWorkQueue () |
| Returns a proxied work queue instance that can be used by composited classes to to assign work to this service. More... | |
| AbstractSessionSharedPtr | getRunningSession () |
| virtual string | getSchema () |
| Returns service schema in XML format. More... | |
| virtual const ServiceDescription & | getServiceDescription () const |
| Access the static service description info. More... | |
| virtual p2p::RoutingRulesSharedPtr | getServiceRoutingInformation () |
| Return service routing information. More... | |
| virtual const ServiceState & | getServiceState () const |
| Gets service state information. More... | |
| AbstractSessionSharedPtr | getSession (int clientId, int sessionId) |
| Returns session by client & session id. More... | |
| int | getStopInterval () const |
| Retrieve service stop interval. More... | |
| WorkQueueInterface * | getWorkQueue () const |
| Access to signal that allows to invoke work(). More... | |
| bool | hasEnumValues (const string &name) |
| Checks if enum has been defined on this service. More... | |
| bool | hasSubscriptions (const string &identifier) |
| Check if the given identifier has any subscriptions. More... | |
| virtual void | initialize (InterfaceDomainBase *domain, ContentClientSharedPtr contentClient, WorkQueueInterface *workQueue) |
| Initialize this service. More... | |
| bool | manualPersistenceOverride () const |
| Defines whether manual persistence override is active, i.e. More... | |
| virtual AbstractSessionSharedPtr | onAcquireSession (int clientId, int sessionId, MessageDispatcher *dispatcher, const string &instanceName)=0 |
| Session factorization method interface. More... | |
| virtual void | onReleaseSession (AbstractSessionSharedPtr session) |
| Virtual method that inheriting classes can implement. More... | |
| void | releaseAllSessions () |
| Unconditionally releases all sessions. use carefully. More... | |
| void | releaseSession (AbstractSessionSharedPtr session) |
| Releases previously allocated session. More... | |
| virtual InvokableOperationResult | removeCustomType (const string &typeName) |
| Remove a custom type from a service. More... | |
| virtual int | removeEvent (const string &identifier) |
| virtual int | removeMethod (const string &identifier) |
| virtual int | removeProperty (const string &identifier) |
| virtual InvokableOperationResult | removeRoute (const string &subjectName) |
| Remove a route from a service. More... | |
| virtual InvokableOperationResult | removeRuntimedataElement (const string &elementIdentifier) |
| Remove runtime data element from the service runtime data. More... | |
| void | removeRuntimeDataSchemaChangeSubscription (RuntimeDataSchemaChangeSubscriptionToken token) |
| Remove schema change subscription. More... | |
| void | removeStateChangeSubscription (StateChangedSubscriptionToken token) |
| Remove state change subscription. More... | |
| vector< string > | removeSubscriptions (AbstractSessionSharedPtr session, const string &identifier="") |
| Remove subscription to the given session for this service. More... | |
| AbstractService::ServiceControlResult | resetService (ServiceArgumentsSharedPtr arguments) |
| Tries to reset service. More... | |
| bool | runScript (const MessagePackage &message, AbstractSessionSharedPtr session, shared_ptr< GenericRPCReplyMessage > &ret) |
| Run a script using configured script plugin. Intended for internal use. More... | |
| ServiceRuntimeData & | runtimeData () |
| Retrieve service runtime data. More... | |
| void | setAttribute (const string &key, const string &value) |
| Add service attributes as key value pairs. More... | |
| void | setDomain (ConnectDomain *domain) |
| Set the connect domain. More... | |
| void | setFileClient (VirtualFileClient *client) |
| Set the client instance to access VirtualFileService. More... | |
| virtual void | setName (const string &name) |
| Defines a override name used to identify the service. More... | |
| void | setPersistence (AbstractService::ServiceDescription::Persistence persistence) |
| Sets the service persistence. More... | |
| virtual void | setRunningSession (AbstractSessionSharedPtr session) |
| Stores the currently running session. More... | |
| virtual InvokableOperationResult | setRuntimedataValue (const string &elementIdentifier, const string &value) |
| Set runtime data value for the given element in the service runtime data. More... | |
| bool | setServiceRuntimeDataSchema (const string &xml) |
| Set service runtime data schema. More... | |
| void | setServiceState (AbstractService::ServiceState state) |
| sets service state information. More... | |
| void | setServiceVersion (AbstractService::ServiceDescription::Version version, AbstractService::ServiceDescription::Version minCompatibleVersion=AbstractService::ServiceDescription::Version()) |
| Configures the service version information. More... | |
| void | setSettingFactory (const persistence::SettingFactory *factory) |
| Set the setting factory instance to allow using persistence service. More... | |
| void | setStopInterval (int seconds) |
| Configures the stop interval. More... | |
| virtual int64_t | setTimer (int64_t milliseconds, ConnectWorkItem::Executor callback) |
| Installs a timer to be called after a specified timeout in milliseconds. More... | |
| virtual int64_t | setTimer (int64_t milliseconds, ConnectWorkItem::Executor callback, ConnectWorkItem::ExecutionContext executionContext) |
| Installs a timer to be called after a specified timeout in milliseconds. More... | |
| bool | simulateEvent (const string &messageName, const MessagePackage &message) |
| Post a message to all running sessions as event. Intended for internal use. More... | |
| AbstractService::ServiceControlResult | startService (ServiceControlSource serviceControlSource, ServiceArgumentsSharedPtr arguments) |
| Tries to start the service. More... | |
| AbstractService::ServiceControlResult | stopService (ServiceControlSource serviceControlSource) |
| Tries to stop the service. More... | |
| virtual void | uninitialize () |
| Uninitialize this service. More... | |
| virtual void | work (ConnectWorkItemSharedPtr workItem) |
| Asks service to perform work. More... | |
| virtual | ~AbstractService () |
| Destructor. More... | |
Protected Member Functions | |
| void | addEnumValue (const string &name, const string &enumerator, int value) |
| Store value for enumeration string. More... | |
| VirtualFileClient * | getFileClient () const |
| Get instance to access the VirtualFileService. More... | |
| ScriptContextSharedPtr | getScriptContext () |
| Get shared script context. More... | |
| const persistence::SettingFactory * | getSettingFactory () const |
| Get the setting factory instance. More... | |
| void | notifyRuntimeSchemaChange () |
| Notify all observers that service schema has changed. More... | |
| virtual void | notifyWork () |
| Allows the derived class to invoke work(). More... | |
| virtual void | notifyWork (ConnectWorkItemSharedPtr workItem) |
| Called notify that this service would have a work item to be processed later on. More... | |
| void | notifyWork (const ConnectWorkItem::Executor executor) |
| Call to notify that provided executor should be run the kanzi connect main thread context. More... | |
| virtual void | notifyWork (ConnectWorkItemSharedPtr workItem, const ConnectWorkItem::Executor executor) |
| Called to notify this service has work to do and for that work use the attached executor. More... | |
| virtual AbstractService::ServiceControlResult | onResetServiceRequest (ServiceArgumentsSharedPtr arguments) |
| Inherited classes should implements this method that is invoked when service is requested to reset itself. More... | |
| virtual AbstractService::ServiceControlResult | onStartServiceRequest (ServiceArgumentsSharedPtr arguments) |
| Inherited classes should implement this method that is invoked when service is to be started. More... | |
| virtual AbstractService::ServiceControlResult | onStopServiceRequest () |
| Inherited classes should implement this method that is invoked when service is to be stopped. More... | |
| bool | prepareScriptContext () |
| Prepare script plugin for use. More... | |
| virtual string | provideServiceRoutingInformationOverride () |
| Service should override this in order to provide a custom routing information structure. More... | |
| virtual string | provideServiceRuntimeDataOverride () |
| Service should override this in order to provide a runtime data structure. More... | |
| void | setConfigurationPropertyPrefix (const string &prefix) |
| Configures the configuration property name prefix used to build fully qualified configuration property names. More... | |
| bool | writeConfigurationPropertyInternal (const string &stream) |
| Writes a configuration property value. More... | |
Abstract base class for Kanzi Connect services.
| typedef map<string, EnumValues> kanzi::connect::AbstractService::EnumMap |
| typedef map<string, int> kanzi::connect::AbstractService::EnumValues |
| typedef function<void(AbstractService*)> kanzi::connect::AbstractService::RuntimeDataSchemaChangeCallback |
Callback prototype to be invoked when runtime data schema changes.
| typedef shared_ptr<void> kanzi::connect::AbstractService::RuntimeDataSchemaChangeSubscriptionToken |
Handle given as return value to runtime data schema change callback registration.
| typedef enum kanzi::connect::AbstractService::ServiceControlResult kanzi::connect::AbstractService::ServiceControlResult |
| typedef enum kanzi::connect::AbstractService::ServiceControlSource kanzi::connect::AbstractService::ServiceControlSource |
Container type for all connected sessions.
| typedef function<void(AbstractService*)> kanzi::connect::AbstractService::StateCallbackFunction |
Function prototype to be invoked when state changes.
| typedef shared_ptr<void> kanzi::connect::AbstractService::StateChangedSubscriptionToken |
Handle given as return value to state callback registration.
| kanzi::connect::AbstractService::AbstractService | ( | ) |
Constructor.
|
virtual |
Destructor.
| AbstractSessionSharedPtr kanzi::connect::AbstractService::acquireSession | ( | int | clientId, |
| int | sessionId, | ||
| MessageDispatcher * | dispatcher, | ||
| const string & | instanceName | ||
| ) |
Session factorization method.
| clientId | client identifier number |
| sessionId | session identifier number |
| dispatcher | message dispatching functionality for the session. |
| instanceName | name for the service/session instance |
|
virtual |
Add a custom type to the service.
| xml | Contains the xml definition for the custom type |
|
virtual |
Add a custom type to the service.
| decodedXml | Contains the xml definition for the custom type in clear xml without base64 encoding |
|
protected |
Store value for enumeration string.
Overwrites existing value if one exists.
| name | Name of the enum definition. |
| enumerator | Enumerator string, identifies the value |
| value | Value to be stored. |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Add new P2P route(s) for the service.
| xml | Contains the xml definition for the route |
|
virtual |
Add new P2P route(s) for the service.
| decodedXml | Contains the xml definition for the route |
| RuntimeDataSchemaChangeSubscriptionToken kanzi::connect::AbstractService::addRuntimeDataSchemaChangeSubscription | ( | RuntimeDataSchemaChangeCallback | function | ) |
Adds a callback to invoke when runtime data schema changes.
| function | function to be called on schema change. |
| StateChangedSubscriptionToken kanzi::connect::AbstractService::addStateChangeSubscription | ( | StateCallbackFunction | function | ) |
Adds a state change callback subscription.
| function | function to be called on state change |
| bool kanzi::connect::AbstractService::addSubscription | ( | const string & | identifier, |
| AbstractSessionSharedPtr | session | ||
| ) |
Add subscription to the given session for this service.
| identifier | Identifies the subscription, what this means is implementation specific |
| session | The session to subscribe |
|
virtual |
Cancels ongoing timer.
| timerId | identifier returned by the setTimer function. |
| int kanzi::connect::AbstractService::countSessions | ( | ) | const |
Amount of allocated sessions.
| size_t kanzi::connect::AbstractService::countSessions | ( | ) |
Return the amount of sessions towards this service amount of sessions.
|
virtual |
Create a new runtime data element for the service runtime data.
| parentIdentifier | Specifies the parent under which create the element in the hierarchy |
| xml | Contains the xml defining the element contents |
| EnumMap::const_iterator kanzi::connect::AbstractService::enumerationValuesBegin | ( | ) |
| EnumMap::const_iterator kanzi::connect::AbstractService::enumerationValuesEnd | ( | ) |
| vector<AbstractSessionSharedPtr> kanzi::connect::AbstractService::findSubscribers | ( | const string & | identifier | ) |
Find all subscribers for the given identifier.
| identifier | Identifies the subscriptions, what this means is implementation specific |
| const SessionContainer& kanzi::connect::AbstractService::getAllSessions | ( | ) | const |
Returns all currently active sessions.
| SessionContainer kanzi::connect::AbstractService::getAllSessionsOfClient | ( | int | clientId | ) |
Returns all sessions for a given client.
| clientId | Id of the client. |
| KanziStringVectorSharedPtr kanzi::connect::AbstractService::getAttributes | ( | ) |
Lists all service attributes.
| RuntimeDataObjectSharedPtr kanzi::connect::AbstractService::getConfigurationProperties | ( | ) |
Retrieves configuration properties as a runtime data object to allow more convenient access to data.
| ContentClientSharedPtr kanzi::connect::AbstractService::getContentClient | ( | ) | const |
Access to content system.
|
virtual |
Returns content provider for this service.
Reimplemented in kanzi::connect::ExternalServiceAdapter.
| const vector<unique_ptr<CustomType> >& kanzi::connect::AbstractService::getCustomTypes | ( | ) | const |
Get the custom types defined for this service.
| KanziStringVectorSharedPtr kanzi::connect::AbstractService::getDisabledInvokables | ( | ) |
| ConnectDomain* kanzi::connect::AbstractService::getDomain | ( | ) | const |
Retrieves the connect domain.
| optional<int> kanzi::connect::AbstractService::getEnumValue | ( | const string & | name, |
| const string & | enumerator | ||
| ) |
Find out value for enumeration string.
| name | Name of the enum definition. Can be empty, first matching enumerator value is returned from all enums |
| enumerator | Enumerator string, identifies the value |
| ServiceExtensionContainer* kanzi::connect::AbstractService::getExtensions | ( | ) |
|
protected |
Get instance to access the VirtualFileService.
| string kanzi::connect::AbstractService::getFullyQualifiedConfigurationPropertyName | ( | const string & | name | ) |
Constructs a fully qualified configuration property name, usually the fully qualified name is something like "Connect.Service.MyService.ConfigurationProperties.MyPropertyName".
| name | the name where the fully qualified name is to be composed |
|
virtual |
Retrieve a generic invoker bound to this service.
Lifetime of the object is the same as the service lifetime. Can be overridden by a class to rewrite functionality.
Reimplemented in kanzi::connect::ExternalServiceAdapter.
|
pure virtual |
Implemented in kanzi::connect::ExternalServiceAdapter.
| InterfaceDomainBase* kanzi::connect::AbstractService::getInterfaceDomain | ( | ) | const |
Access to interface domain.
|
inlinevirtual |
Retrieves modified configuration properties as runtime data object.
Overriden by corresponding Concept class.
|
virtual |
Returns the override name.
| WorkQueueInterface* kanzi::connect::AbstractService::getProxyWorkQueue | ( | ) |
Returns a proxied work queue instance that can be used by composited classes to to assign work to this service.
|
inline |
|
virtual |
Returns service schema in XML format.
|
protected |
Get shared script context.
|
virtual |
Access the static service description info.
|
inlinevirtual |
Return service routing information.
|
virtual |
Gets service state information.
| AbstractSessionSharedPtr kanzi::connect::AbstractService::getSession | ( | int | clientId, |
| int | sessionId | ||
| ) |
Returns session by client & session id.
| clientId | Id of the client. |
| sessionId | Id of the session. |
|
protected |
Get the setting factory instance.
| int kanzi::connect::AbstractService::getStopInterval | ( | ) | const |
Retrieve service stop interval.
| WorkQueueInterface* kanzi::connect::AbstractService::getWorkQueue | ( | ) | const |
Access to signal that allows to invoke work().
| bool kanzi::connect::AbstractService::hasEnumValues | ( | const string & | name | ) |
Checks if enum has been defined on this service.
| name | Name of the enum definition. |
| bool kanzi::connect::AbstractService::hasSubscriptions | ( | const string & | identifier | ) |
Check if the given identifier has any subscriptions.
| identifier | The identifier to check, what this means is implementation specific |
|
virtual |
Initialize this service.
| domain | Interface domain. |
| contentClient | Content Client that can be used to expose runtime state of this service to clients. |
| workQueue | Interface to system work queue used to dispatch work to services. |
| bool kanzi::connect::AbstractService::manualPersistenceOverride | ( | ) | const |
Defines whether manual persistence override is active, i.e.
user has manually configured service to a state and thus automatic shutdown is not active.
|
protected |
Notify all observers that service schema has changed.
|
protectedvirtual |
Allows the derived class to invoke work().
|
protectedvirtual |
Called notify that this service would have a work item to be processed later on.
|
protected |
Call to notify that provided executor should be run the kanzi connect main thread context.
| executor | the executor to be executed in main thread context. |
|
protectedvirtual |
Called to notify this service has work to do and for that work use the attached executor.
| workItem | describes the work to be done |
| executor | the executor for work item. |
|
pure virtual |
Session factorization method interface.
To be overrided by concrete services
| clientId | client identifier number |
| sessionId | session identifier number |
| dispatcher | message dispatching functionality for the session. |
| instanceName | name for the service/session instance |
Implemented in kanzi::connect::ExternalServiceAdapter.
|
virtual |
Virtual method that inheriting classes can implement.
Can be used to receive notifications when sessions are destroyed.
| session | identifies the session to be released. ownership not transfered. |
Reimplemented in kanzi::connect::ExternalServiceAdapter.
|
protectedvirtual |
Inherited classes should implements this method that is invoked when service is requested to reset itself.
return status indicating whether reset was succeeded or not.
|
protectedvirtual |
Inherited classes should implement this method that is invoked when service is to be started.
| arguments | possible arguments for the service. |
|
protectedvirtual |
Inherited classes should implement this method that is invoked when service is to be stopped.
|
protected |
Prepare script plugin for use.
|
protectedvirtual |
Service should override this in order to provide a custom routing information structure.
|
protectedvirtual |
Service should override this in order to provide a runtime data structure.
| void kanzi::connect::AbstractService::releaseAllSessions | ( | ) |
Unconditionally releases all sessions. use carefully.
| void kanzi::connect::AbstractService::releaseSession | ( | AbstractSessionSharedPtr | session | ) |
Releases previously allocated session.
| session | the session to release. ownership not transfered. |
|
virtual |
Remove a custom type from a service.
| typeName | The name of the type |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Remove a route from a service.
| subjectName | The subject of the route (can be method name, event name or "runtimedata") |
|
virtual |
Remove runtime data element from the service runtime data.
| elementIdentifier | Specifies which element to remove |
| void kanzi::connect::AbstractService::removeRuntimeDataSchemaChangeSubscription | ( | RuntimeDataSchemaChangeSubscriptionToken | token | ) |
Remove schema change subscription.
| token | to remove. |
| void kanzi::connect::AbstractService::removeStateChangeSubscription | ( | StateChangedSubscriptionToken | token | ) |
Remove state change subscription.
| token | to remove. |
| vector<string> kanzi::connect::AbstractService::removeSubscriptions | ( | AbstractSessionSharedPtr | session, |
| const string & | identifier = "" |
||
| ) |
Remove subscription to the given session for this service.
| session | The session whose subscriptions are to be removed |
| identifier | The subscriptions to remove, if empty all subscriptions for the session are removed |
| AbstractService::ServiceControlResult kanzi::connect::AbstractService::resetService | ( | ServiceArgumentsSharedPtr | arguments | ) |
Tries to reset service.
Returnvalue indicates the status of execution.
| arguments | optional arguments passed along with the control request. |
| bool kanzi::connect::AbstractService::runScript | ( | const MessagePackage & | message, |
| AbstractSessionSharedPtr | session, | ||
| shared_ptr< GenericRPCReplyMessage > & | ret | ||
| ) |
Run a script using configured script plugin. Intended for internal use.
| ServiceRuntimeData& kanzi::connect::AbstractService::runtimeData | ( | ) |
Retrieve service runtime data.
| void kanzi::connect::AbstractService::setAttribute | ( | const string & | key, |
| const string & | value | ||
| ) |
Add service attributes as key value pairs.
These will be visible on service description, but don't affect runtime state
|
protected |
Configures the configuration property name prefix used to build fully qualified configuration property names.
| prefix | the prefix to be stored. |
| void kanzi::connect::AbstractService::setDomain | ( | ConnectDomain * | domain | ) |
Set the connect domain.
| domain | the domain |
| void kanzi::connect::AbstractService::setFileClient | ( | VirtualFileClient * | client | ) |
Set the client instance to access VirtualFileService.
| client | Pointer to the instance which is used to access the service |
|
virtual |
Defines a override name used to identify the service.
| name | the name |
| void kanzi::connect::AbstractService::setPersistence | ( | AbstractService::ServiceDescription::Persistence | persistence | ) |
Sets the service persistence.
| persistence | the persistence type for the service. |
|
inlinevirtual |
Stores the currently running session.
Should not be called from 3rd party code - used only internally by the infrastructure.
|
virtual |
Set runtime data value for the given element in the service runtime data.
| elementIdentifier | Identifies the element in the service runtime data |
| value | The value to set in serialized format |
| bool kanzi::connect::AbstractService::setServiceRuntimeDataSchema | ( | const string & | xml | ) |
Set service runtime data schema.
All previously configured runtime data specific settings are discarded. New schema is also delivered to client(s).
| xml | XML format schema |
| void kanzi::connect::AbstractService::setServiceState | ( | AbstractService::ServiceState | state | ) |
sets service state information.
| state | the state |
| void kanzi::connect::AbstractService::setServiceVersion | ( | AbstractService::ServiceDescription::Version | version, |
| AbstractService::ServiceDescription::Version | minCompatibleVersion = AbstractService::ServiceDescription::Version() |
||
| ) |
Configures the service version information.
This should be called in constructor.
| version | the main version of the service |
| minCompatibleVersion | minimum compatible version. |
| void kanzi::connect::AbstractService::setSettingFactory | ( | const persistence::SettingFactory * | factory | ) |
Set the setting factory instance to allow using persistence service.
| factory | Pointer to the instance which is used to instantiate setting objects |
| void kanzi::connect::AbstractService::setStopInterval | ( | int | seconds | ) |
Configures the stop interval.
| seconds | the value to set. Negative values are rounded to 0. |
|
virtual |
Installs a timer to be called after a specified timeout in milliseconds.
| milliseconds | timeout in milliseconds |
| callback | function to be called when timer expires. |
|
virtual |
Installs a timer to be called after a specified timeout in milliseconds.
| milliseconds | timeout in milliseconds |
| callback | function to be called when timer expires. |
| executionContext | Defines in which thread the callback should be executed. |
| bool kanzi::connect::AbstractService::simulateEvent | ( | const string & | messageName, |
| const MessagePackage & | message | ||
| ) |
Post a message to all running sessions as event. Intended for internal use.
| AbstractService::ServiceControlResult kanzi::connect::AbstractService::startService | ( | ServiceControlSource | serviceControlSource, |
| ServiceArgumentsSharedPtr | arguments | ||
| ) |
Tries to start the service.
Returnvalue indicates if operation fails
| serviceControlSource | what caused the service control to be accomplished. |
| arguments | the arguments to use when starting the service. Similar to command line arguments on shell - effectively a list of strings. |
| AbstractService::ServiceControlResult kanzi::connect::AbstractService::stopService | ( | ServiceControlSource | serviceControlSource | ) |
Tries to stop the service.
Shall the stop fail or otherwise not supported then scenario must be indicated with return value
| serviceControlSource | what caused the service control to be accomplished. |
|
virtual |
Uninitialize this service.
|
virtual |
Asks service to perform work.
|
protected |
Writes a configuration property value.
| stream | serialized objects where-from to read the value |