A class that abstracts server-side & client-side access to content manager. More...
#include <content_client.hpp>
Classes | |
class | ContentClientObserver |
Polymorphic C++ observer interface for table based content subscriptions. More... | |
class | ContentClientRuntimeDataObserver |
Polymorphic C++ observer interface for runtime data subscriptions. More... | |
Public Types | |
typedef function< void(const string &uri, int reason, int startRow, int endRow) | ContentInvalidationFunction) |
Callback function for content invalidation. | |
typedef shared_ptr< void > | ContentToken |
A token that identifies the content session / consumer. | |
typedef function< void(const string &uri, ContentDataSharedPtr data) | ResultCallbackFunction) |
Callback function for content result. | |
typedef function< void(const string &uri, RuntimeDataObjectSharedPtr data) | RuntimeDataResultCallbackFunction) |
callback function for runtimedata content result. | |
![]() | |
typedef function< void(void)> | SessionRunningFunction |
typedef shared_ptr< void > | SessionRunningSubscriptionToken |
typedef function< void(void)> | SessionStoppedFunction |
Public Member Functions | |
virtual ContentToken | acquireContentToken ()=0 |
Acquire content token and register as user of content service. | |
virtual bool | addContentProvider (ContentToken token, const string &uri, ContentProviderSharedPtr contentProvider)=0 |
Adds content provider to content system. | |
virtual string | getIdentifier () const |
Returns the type of the service. | |
virtual bool | getVerboseLog () const =0 |
Return the current state of log verbosity. | |
virtual bool | hasSession (ContentToken token)=0 |
Determine whether specific content token has session currently available. | |
virtual void | releaseContentToken (ContentToken token)=0 |
Release content token and unregister from content service. | |
virtual void | removeContentProvider (ContentToken token, ContentProviderSharedPtr contentProvider)=0 |
Removes content provider from content system. | |
virtual void | setVerboseLog (bool verbose)=0 |
Configures verbose logging for the content client. | |
virtual bool | subscribe (ContentToken token, ContentQueryArgumentsSharedPtr args, ResultCallbackFunction callback, ContentInvalidationFunction invalidationCallback)=0 |
Subscribe to a table based content. | |
virtual bool | subscribeEx (ContentToken token, ContentQueryArgumentsSharedPtr args, ContentClientObserver *observer)=0 |
Subscribe to content. | |
virtual bool | subscribeRuntimeData (ContentToken token, const string uri, RuntimeDataResultCallbackFunction callback, int credits, int creditreturninterval)=0 |
Subscribes to a service runtime data. | |
virtual bool | subscribeRuntimeDataEx (ContentToken token, const string uri, ContentClientRuntimeDataObserver *observer, int credits, int creditreturninterval)=0 |
Subscribe to service runtime data. | |
virtual void | unsubscribe (ContentToken token, const string &uri)=0 |
Unsubscribe from content URI. | |
virtual void | unsubscribeRuntimeData (ContentToken token, const string &URI)=0 |
Unsubscribe from runtime data. | |
virtual void | work () |
See AbstractServiceClient::work() | |
virtual | ~ContentClient () |
Destructor. | |
![]() | |
AbstractServiceClient () | |
Constructor. | |
AbstractSession::MessageSubscriptionToken | addMessageSubscription (const string &messageType, AbstractSession::MessageReceivedFunction function) |
SessionRunningSubscriptionToken | addSessionRunningSubscription (SessionRunningFunction function) |
SessionRunningSubscriptionToken | addSessionStoppedSubscription (SessionStoppedFunction function) |
optional< int > | getActiveSessionIdentifier () |
optional< const AbstractSession::ServiceAttributes > | getServiceAttributes () |
virtual void | onSessionRunning () |
virtual void | onSessionStopped () |
void | removeMessageSubscription (const string &messageType, AbstractSession::MessageSubscriptionToken token) |
void | removeSessionRunningSubscription (SessionRunningSubscriptionToken token) |
void | removeSessionStoppedSubscription (SessionRunningSubscriptionToken token) |
void | setEnabledState (bool newEnabledState) |
Enable/disable the service by allowing or blocking traffic between client and server. | |
bool | transmit (const MessagePackage &message) |
virtual | ~AbstractServiceClient () |
Destructor. | |
Static Public Member Functions | |
static string | Type () |
Type accessors. | |
Protected Member Functions | |
ContentClient () | |
Constructor. | |
![]() | |
virtual AbstractSessionSharedPtr | getSession () |
Additional Inherited Members | |
![]() | |
enum | SessionState { INITIALIZED = 0 , RUNNING = 1 , STOPPED = 2 } |
![]() | |
SessionState | m_sessionState |
A class that abstracts server-side & client-side access to content manager.
This class makes it possible to acquire or release a token that can be used to subscribe to content in the content database. The content token can also be used to register content to the server-side content database. This abstraction makes it possible to write content providers and consumers that can operate both locally (server-side) and remotely (client-side).
typedef function<void(const string& uri, int reason, int startRow, int endRow) kanzi::connect::ContentClient::ContentInvalidationFunction) |
Callback function for content invalidation.
typedef shared_ptr<void> kanzi::connect::ContentClient::ContentToken |
A token that identifies the content session / consumer.
typedef function<void(const string& uri, ContentDataSharedPtr data) kanzi::connect::ContentClient::ResultCallbackFunction) |
Callback function for content result.
typedef function<void(const string& uri, RuntimeDataObjectSharedPtr data) kanzi::connect::ContentClient::RuntimeDataResultCallbackFunction) |
callback function for runtimedata content result.
|
virtual |
Destructor.
|
protected |
Constructor.
|
pure virtual |
Acquire content token and register as user of content service.
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Adds content provider to content system.
token | Content token, identifies the user of content API, needs to be acquired first. |
uri | Content URI that is handled by the content provider. |
contentProvider | Content provider to add. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
inlinevirtual |
Returns the type of the service.
Implements kanzi::connect::AbstractServiceClient.
|
pure virtual |
Return the current state of log verbosity.
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Determine whether specific content token has session currently available.
token | content token |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Release content token and unregister from content service.
token | the content token to release. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Removes content provider from content system.
token | Content token, identifies the user of content API, needs to be acquired first. |
contentProvider | Content provider to remove. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Configures verbose logging for the content client.
verbose | whether to be verbose or not. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Subscribe to a table based content.
token | Content token, identifies the user of content API, needs to be acquired first. When subscribing to table based content (content:// or service://) new token must be allocated for each content domain (E.g. com.rightware.content). |
args | Query Arguments. |
callback | Function callback for results. |
invalidationCallback | function to invoke when content provider informs that certain part of the content has been invalidated. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Subscribe to content.
token | content content, identifies the user of content API. |
args | Query Arguments. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Subscribes to a service runtime data.
token | Content token, identifies the user of content API. |
uri | The content URI where to subscribe. Usually something like service://cluster. |
callback | Function callback for results. |
credits | amount of transter credits that define the maximum amount of queued items (including both service and client ends) of this type. |
creditreturninterval | how often functionality will return transfer credits to the content producer. Smaller the value more housekeeping traffic is produced. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Subscribe to service runtime data.
token | Content token, identifies the user of content API, needs to be acquired first. |
observer | Observer interface to be invoked when subscribed runtime data changes. |
credits | amount of transter credits that define the maximum amount of queued items (including both service and client ends) of this type. |
creditreturninterval | how often functionality will return transfer credits to the content producer. Smaller the value more housekeeping traffic is produced. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
inlinestatic |
Type accessors.
|
pure virtual |
Unsubscribe from content URI.
token | Content token. |
uri | Content URI to unsubscribe. Must be previously subscribed. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
pure virtual |
Unsubscribe from runtime data.
token | Content token to unsubscribe. |
uri | Service URI where to unsubscribe from. |
Implemented in kanzi::connect::LocalContentClient, and kanzi::connect::RemoteContentClient.
|
inlinevirtual |
See AbstractServiceClient::work()
Reimplemented from kanzi::connect::AbstractServiceClient.
Reimplemented in kanzi::connect::RemoteContentClient.