Encapsulates service runtime data. More...
#include <serviceruntimedataregisterer.hpp>
Public Types | |
typedef shared_ptr< void > | ContentRegistrationToken |
typedef shared_ptr< void > | ContentSubscriptionToken |
typedef function< void(const string &, const string &) | RuntimeContentUpdateCallback) |
Public Member Functions | |
RuntimeDataObjectSharedPtr | getRootObjectForRegistration (ContentRegistrationToken token) |
Retrieves the root object associated with the specific content registration token. | |
RuntimeDataObjectSharedPtr | getRootObjectForSubscription (ContentSubscriptionToken token) |
Retrieves the root object associated with the specific content listener token. | |
const string | getSchemaForSubscription (ContentSubscriptionToken token) |
Retrieve XML format schema for content subscription. | |
void | initializeHTTP () |
Initializes HTTP Functionality. | |
ContentSubscriptionToken | registerContentListener (const string &path, RuntimeContentUpdateCallback callback) |
Registers runtime content listener to a specific path. | |
ContentRegistrationToken | registerContentProducer (const string &servicename, const string &xml) |
Registers a content producer from XML schema definition. | |
ContentRegistrationToken | registerContentProducer (const string &servicename, RuntimeDataObjectSharedPtr dataRoot, const string &schema) |
Registers a content producer, aka a service. | |
bool | renameContentProducer (const string &oldname, const string &newname) |
Renames a content producer. | |
ServiceRuntimeDataRegistry (ConnectDomainSharedPtr domain=nullptr, DiagnosticsManagerSharedPtr diagnostics=DiagnosticsManagerSharedPtr()) | |
C++ constructor. | |
void | uninitializeHTTP () |
Uninitialize HTTP Functionality. | |
void | unregisterContentListener (ContentSubscriptionToken token) |
Unregisters content listener. | |
void | unregisterContentProducer (ContentRegistrationToken handle) |
Unregister content producer. | |
bool | updateData (ContentRegistrationToken handle, const string &stream, const string &path) |
Updates the data of a specific registration. | |
bool | updateDataForPath (ContentRegistrationToken handle, const string &path) |
Updates the data of specific registration and especially a specified path within it. | |
ServiceRuntimeDataRegistry::ContentRegistrationToken | updateSchema (ContentRegistrationToken token, const string &schema) |
Updates the schema at runtime. | |
ContentRegistrationToken | updateSchema (ContentRegistrationToken token, RuntimeDataObjectSharedPtr dataRoot, const string &schema) |
Changes the runtime data schema. | |
![]() | |
virtual void | cancelAllPendingRequests () |
virtual | ~VirtualFileProvider () |
Virtual destructor for cleanup. | |
Public Attributes | |
bool | m_active |
True if data should be distributed. | |
DiagnosticsManagerSharedPtr | m_diagnostics |
Diagnostics manager. | |
ConnectDomainSharedPtr | m_domain |
The domain. | |
VirtualFileLocalClientSharedPtr | m_HTTPClient |
HTTP Client for HTTP Communications. | |
VirtualFileClient::RegistrationToken | m_HTTPSchemaToken |
HTTP Schema token. | |
VirtualFileClient::RegistrationToken | m_HTTPToken |
HTTP registration token. | |
Protected Member Functions | |
virtual void | provideFile (const string &path, VirtualFileResponseSharedPtr response) override |
Invoked when there is a requirement to provide a file. | |
Encapsulates service runtime data.
typedef shared_ptr<void> kanzi::connect::ServiceRuntimeDataRegistry::ContentRegistrationToken |
typedef shared_ptr<void> kanzi::connect::ServiceRuntimeDataRegistry::ContentSubscriptionToken |
typedef function<void(const string&, const string&) kanzi::connect::ServiceRuntimeDataRegistry::RuntimeContentUpdateCallback) |
kanzi::connect::ServiceRuntimeDataRegistry::ServiceRuntimeDataRegistry | ( | ConnectDomainSharedPtr | domain = nullptr, |
DiagnosticsManagerSharedPtr | diagnostics = DiagnosticsManagerSharedPtr() ) |
C++ constructor.
domain | the connect domain (optional) |
diagnostics | diagnostics functionality for traffic logging etc. |
RuntimeDataObjectSharedPtr kanzi::connect::ServiceRuntimeDataRegistry::getRootObjectForRegistration | ( | ContentRegistrationToken | token | ) |
Retrieves the root object associated with the specific content registration token.
token | the content registration token |
RuntimeDataObjectSharedPtr kanzi::connect::ServiceRuntimeDataRegistry::getRootObjectForSubscription | ( | ContentSubscriptionToken | token | ) |
Retrieves the root object associated with the specific content listener token.
token | the token to query |
const string kanzi::connect::ServiceRuntimeDataRegistry::getSchemaForSubscription | ( | ContentSubscriptionToken | token | ) |
Retrieve XML format schema for content subscription.
token | identifies the subscription |
void kanzi::connect::ServiceRuntimeDataRegistry::initializeHTTP | ( | ) |
Initializes HTTP Functionality.
Must be called after HTTP Functionality itself has been initialized.
|
overrideprotectedvirtual |
Invoked when there is a requirement to provide a file.
path | requested path. |
response | the response object that is to be completed within the callback. Object must not be stored by called entity. |
Implements kanzi::connect::VirtualFileProvider.
ContentSubscriptionToken kanzi::connect::ServiceRuntimeDataRegistry::registerContentListener | ( | const string & | path, |
RuntimeContentUpdateCallback | callback ) |
Registers runtime content listener to a specific path.
path | where to register. |
ContentRegistrationToken kanzi::connect::ServiceRuntimeDataRegistry::registerContentProducer | ( | const string & | servicename, |
const string & | xml ) |
Registers a content producer from XML schema definition.
This is used with remote services.
servicename | name of the service |
xml | xml contents |
ContentRegistrationToken kanzi::connect::ServiceRuntimeDataRegistry::registerContentProducer | ( | const string & | servicename, |
RuntimeDataObjectSharedPtr | dataRoot, | ||
const string & | schema ) |
Registers a content producer, aka a service.
servicename | The name of the service. |
dataRoot | The root object. |
bool kanzi::connect::ServiceRuntimeDataRegistry::renameContentProducer | ( | const string & | oldname, |
const string & | newname ) |
Renames a content producer.
Required for example by simulator when service models name is changed
oldname | the old name. |
newname | the new name. |
void kanzi::connect::ServiceRuntimeDataRegistry::uninitializeHTTP | ( | ) |
Uninitialize HTTP Functionality.
void kanzi::connect::ServiceRuntimeDataRegistry::unregisterContentListener | ( | ContentSubscriptionToken | token | ) |
Unregisters content listener.
token | what to unregister. |
void kanzi::connect::ServiceRuntimeDataRegistry::unregisterContentProducer | ( | ContentRegistrationToken | handle | ) |
Unregister content producer.
handle | the handle of operation |
bool kanzi::connect::ServiceRuntimeDataRegistry::updateData | ( | ContentRegistrationToken | handle, |
const string & | stream, | ||
const string & | path ) |
Updates the data of a specific registration.
handle | identifies the updated, earlier returned by registerContentProducer |
stream | the serialized update content. |
path | the path that was reported to be changed. |
bool kanzi::connect::ServiceRuntimeDataRegistry::updateDataForPath | ( | ContentRegistrationToken | handle, |
const string & | path ) |
Updates the data of specific registration and especially a specified path within it.
handle | identifies the updated, earlier returned by registerContentProducer |
path | the path that changed. |
ServiceRuntimeDataRegistry::ContentRegistrationToken kanzi::connect::ServiceRuntimeDataRegistry::updateSchema | ( | ContentRegistrationToken | token, |
const string & | schema ) |
Updates the schema at runtime.
token | identifies the content registration |
schema | new xml definition of the data |
ContentRegistrationToken kanzi::connect::ServiceRuntimeDataRegistry::updateSchema | ( | ContentRegistrationToken | token, |
RuntimeDataObjectSharedPtr | dataRoot, | ||
const string & | schema ) |
Changes the runtime data schema.
token | the token that identifies the previously registered content producer |
dataRoot | the root object. |
schema | the xml schema that defines the new structure. |
bool kanzi::connect::ServiceRuntimeDataRegistry::m_active |
True if data should be distributed.
DiagnosticsManagerSharedPtr kanzi::connect::ServiceRuntimeDataRegistry::m_diagnostics |
Diagnostics manager.
ConnectDomainSharedPtr kanzi::connect::ServiceRuntimeDataRegistry::m_domain |
The domain.
VirtualFileLocalClientSharedPtr kanzi::connect::ServiceRuntimeDataRegistry::m_HTTPClient |
HTTP Client for HTTP Communications.
VirtualFileClient::RegistrationToken kanzi::connect::ServiceRuntimeDataRegistry::m_HTTPSchemaToken |
HTTP Schema token.
VirtualFileClient::RegistrationToken kanzi::connect::ServiceRuntimeDataRegistry::m_HTTPToken |
HTTP registration token.