RemoteServiceHost¶
-
class
kanzi::connect
::
RemoteServiceHost
: public ServiceHost¶ A class that manages a service that is running remotely over the network.
Unnamed Group
-
string getIdentifier () const KZ_OVERRIDE
Retrieve interface identifier.
- Return
interface ID this service handles.
-
void changeType (const string &type) KZ_OVERRIDE
Changes the interface name at runtime.
- Parameters
type
: new type for the interface.
-
void initialize (InterfaceDomainBase *domain, ContentClientSharedPtr contentClient, WorkQueueInterface *workQueue) KZ_OVERRIDE
Initialize the service.
- Parameters
domain
: environment where the service is run in.contentClient
: access to content systemworkQueue
: interface to work queue used to dispatch work service is ready will eventually cause the services work() method to be invoked.
-
void uninitialize () KZ_OVERRIDE
cleanup the service.
-
AbstractSessionSharedPtr acquireSession (ConnectedClientSharedPtr client, int sessionId) KZ_OVERRIDE
Creates a session to this service.
- Return
session instance. ownership not transfered.
- Parameters
client
: identifies the client.sessionId
: identifies the session.
-
void releaseSession (int clientId, int sessionId) KZ_OVERRIDE
Releases a session.
- Parameters
clientId
: identifies the clientsessionId
: identifies the session
-
void work (ConnectWorkItemSharedPtr workItem) KZ_OVERRIDE
Routine that get(s) called periodically or especially when object itself has requested it to be called using the work queue.
- Parameters
workItem
: Item to be processed.
-
void receiveMessage (ConnectedClientSharedPtr client, const MessagePackage &message) KZ_OVERRIDE
Invoked for each message this service should handle.
- Parameters
client
: identifies the message sendermessage
: the message to process.
-
void notifyClientDisconnected (int clientId) KZ_OVERRIDE
Invoked to inform that specific client has disconnected.
- Parameters
clientId
: Identifies the client.
-
const AbstractService::ServiceDescription & getDescription () KZ_OVERRIDE
Retrieve the service description from service host.
- Return
const reference to service description
-
const AbstractService::ServiceState & getState () KZ_OVERRIDE
Retrieve the service state information.
- Return
const reference to service state information.
-
bool local () const KZ_OVERRIDE
Is this service local or not.
- Return
true if service is local
-
shared_ptr< ServiceServiceConcept::Session > getServiceSession () const KZ_OVERRIDE
Returns a session to remote service.
Relevant only for remote services.
- Return
session
-
int clientID () const KZ_OVERRIDE
Returns the client identifier.
Relevant only for remote clients. Will return -1 for local clients.
- Return
client identifier.
-
AbstractServiceSharedPtr getService () const KZ_OVERRIDE
Returns a service instance.
Relevant only for local services.
- Return
service
-
int countSessions () const KZ_OVERRIDE
Returns amount of sessions towards this service.
- Return
amount of sessions
-
ClientDescriptorSharedPtr getClientDescriptor () KZ_OVERRIDE
Return the client descriptor.
Relevant only for remote services.
- Return
client descriptor
-
void setConfigurationProperties (RuntimeDataObjectSharedPtr properties) KZ_OVERRIDE
Stores service configuration properties.
Default implementation is empty, should be overridden by the remote service host implementation
- Parameters
properties
: data object describing the properties.
-
RuntimeDataObjectSharedPtr getConfigurationProperties () KZ_OVERRIDE
Retrieve service configuration properties.
- Return
properties as shared object.
-
void setState (const AbstractService::ServiceState &state) KZ_OVERRIDE
Sets the service state.
Relevant only for remote clients.
- Parameters
state
: new state for remote clients.
-
string getServiceRoutingInformationDescription (int serverclientid) KZ_OVERRIDE
Must be overridden by the corresponding implementation.
- Return
xml format routing information for the service.
-
bool reportServiceRuntimeData (const string &, const string &) KZ_OVERRIDE
Can be called, mainly for remote services, to inform about new service information that was received.
-
void notifyAll (const MessagePackage &event) KZ_OVERRIDE
Internal API for scripting utilities makes assumptions on implementation details.
Do not use.
-
RuntimeDataObject * getRuntimeData () KZ_OVERRIDE
Internal API for scripting utilities makes assumptions on implementation details.
Do not use.
Public Functions
Constructor.
- Parameters
type
: the service interface identifierserviceSession
: pointer to session. Ownership does not transfer.
-
~RemoteServiceHost () KZ_OVERRIDE
Destructor.
-
void
initializeFlowControl
(int credits, int creditreturninterval)¶ Initialize flow control object.
- Parameters
credits
: amount of credits initiallycreditreturninterval
: how often return credits to service.
-
bool
registerRoutingInformationSchema
(const string &schema)¶ Register routing information schema.
- Return
true if registration succeeds.
- Parameters
routing
: information schema to register.
-
bool
registerServiceDescriptionSchema
(const string &schema)¶ Invoked to register service description xml.
- Return
true if registration succeeded.
- Parameters
schema
: the schema (xml)
Sets a client descriptor.
- Parameters
clientDescription
: The information to set.
-
void
setDescription
(const AbstractService::ServiceDescription &description)¶ Set service description for a remote service.
- Parameters
description
: the description to set
-