A content client variant that provides remote access to the content manager over network. More...
#include <content_client_remote.hpp>
Public Member Functions | |
ContentInterfaceClient * | getInterface () |
Returns the underlying content interface. | |
virtual void | work () override |
Perform work that is pending. Called on main thread. | |
virtual | ~RemoteContentClient () |
Destructor. | |
virtual ContentToken | acquireContentToken () override |
virtual void | releaseContentToken (ContentToken token) override |
Release content token and unregister from content service. | |
virtual bool | subscribe (ContentToken token, ContentQueryArgumentsSharedPtr args, ResultCallbackFunction callback, ContentInvalidationFunction invalidationCallback) override |
Subscribe to a table based content. | |
virtual bool | subscribeRuntimeData (ContentToken token, const string uri, RuntimeDataResultCallbackFunction callback, int credits, int creditreturninterval) override |
Subscribes to a service runtime data. | |
virtual bool | subscribeEx (ContentToken token, ContentQueryArgumentsSharedPtr args, ContentClientObserver *observer) override |
Subscribe to content. | |
virtual bool | subscribeRuntimeDataEx (ContentToken token, const string uri, ContentClientRuntimeDataObserver *observer, int credits, int creditreturninterval) override |
Subscribe to service runtime data. | |
virtual void | unsubscribe (ContentToken token, const string &uri) override |
Unsubscribe from content URI. | |
virtual void | unsubscribeRuntimeData (ContentToken token, const string &uri) override |
Unsubscribe from runtime data. | |
virtual bool | addContentProvider (ContentToken token, const string &uri, ContentProviderSharedPtr contentProvider) override |
Adds content provider to content system. | |
virtual void | removeContentProvider (ContentToken token, ContentProviderSharedPtr contentProvider) override |
Removes content provider from content system. | |
virtual bool | hasSession (ContentToken token) override |
Determine whether specific content token has session currently available. | |
virtual void | setVerboseLog (bool verbose) override |
Configures verbose logging for the content client. | |
virtual bool | getVerboseLog () const override |
Return the current state of log verbosity. | |
![]() | |
virtual string | getIdentifier () const |
Returns the type of the service. | |
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 RemoteContentClientSharedPtr | create (ClientSharedPtr client) |
Creates a new instance of RemoteContentClient class. | |
![]() | |
static string | Type () |
Type accessors. | |
Protected Member Functions | |
virtual void | onConnectionStateChanged (Connection::State state) |
Callback to get notification when the state of the network changes. | |
RemoteContentClient (ClientSharedPtr client) | |
Constructor. | |
![]() | |
ContentClient () | |
Constructor. | |
![]() | |
virtual AbstractSessionSharedPtr | getSession () |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
enum | SessionState { INITIALIZED = 0 , RUNNING = 1 , STOPPED = 2 } |
![]() | |
SessionState | m_sessionState |
A content client variant that provides remote access to the content manager over network.
This class can be used in Kanzi Connect client to operate with the Content Service. The guidelines for the usage:
|
virtual |
Destructor.
|
protected |
Constructor.
|
overridevirtual |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
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. |
Implements kanzi::connect::ContentClient.
|
static |
Creates a new instance of RemoteContentClient class.
client | Client class that provides access to Kanzi Connect network. |
ContentInterfaceClient * kanzi::connect::RemoteContentClient::getInterface | ( | ) |
Returns the underlying content interface.
|
overridevirtual |
Return the current state of log verbosity.
Implements kanzi::connect::ContentClient.
|
overridevirtual |
Determine whether specific content token has session currently available.
token | content token |
Implements kanzi::connect::ContentClient.
|
protectedvirtual |
Callback to get notification when the state of the network changes.
|
overridevirtual |
Release content token and unregister from content service.
token | the content token to release. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
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. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
Configures verbose logging for the content client.
verbose | whether to be verbose or not. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
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. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
Subscribe to content.
token | content content, identifies the user of content API. |
args | Query Arguments. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
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. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
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. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
Unsubscribe from content URI.
token | Content token. |
uri | Content URI to unsubscribe. Must be previously subscribed. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
Unsubscribe from runtime data.
token | Content token to unsubscribe. |
uri | Service URI where to unsubscribe from. |
Implements kanzi::connect::ContentClient.
|
overridevirtual |
Perform work that is pending. Called on main thread.
Reimplemented from kanzi::connect::ContentClient.