ContentManager¶
-
class
kanzi::connect::ContentManager: public ContentServiceConcept, public VirtualFileProvider¶ A class that acts as a content service that is an interface for all database content on server.
Implements ContentInterface, which allows to subscribe / unsubscribe to content.
Public Types
-
typedef function<void(const string &uri, int reason, int startRow, int endRow)>
ContentInvalidationCallback¶
-
typedef function<void(const string &uri, ContentDataSharedPtr data)>
ContentResultCallback¶ Callback function for content result.
-
typedef function<ContentProvider*(WorkQueueInterface *workQueue)>
CreationFunction¶ Creator function type for content providers.
-
typedef map<string, shared_ptr<ContentProvider>>
ProviderContainer¶
-
typedef ProviderContainer::iterator
ProviderContainerIterator¶
-
typedef function<void(const string &uri, RuntimeDataObjectSharedPtr data)>
RuntimeDataContentResultCallback¶
Public Functions
-
ContentManager(ConnectDomain *domain)¶ Constructor.
-
~ContentManager()¶ Destructor.
Adds existing content provider to system.
- Parameters
uri: URI that is covered by this content provider.contentProvider: Content provider instance to add to system.
Registers remote query to the system.
Allows to wait for remote content provider to respond.
- Parameters
queryId: Unique identifier for the query.query: Query to register.
-
vector<ContentProviderSharedPtr>
getAllKnownContentProviders()¶ Retrieves all known content providers.
- Return
vector of content providers.
-
ContentProviderCollectionSharedPtr getContentProvider () KZ_OVERRIDE Returns the content provider collection that contains all registered content on server.
- Return
Collection of content providers.
-
shared_ptr<RemoteQuery>
getPendingQuery(unsigned int queryId) const¶ Retrieves pending remote query by it’s unique id.
- Return
Resulting query object.
- Parameters
queryId: Id of the query to retrieve.
-
WorkQueueInterface *
getProxyWorkQueue()¶ Returns a proxied work queue instance that can be used by composited classes to to assign work to this service.
- Note
Returned interface will become invalid immediately when uninitialize() gets called for this Service.
- Return
pointer to interface that can be used dispatch event(s) to this particular service.
-
WorkQueueInterface *
getWorkQueue() const¶ Access to signal that allows to invoke work().
- Return
The signal.
-
void initialize (InterfaceDomainBase *domain, ContentClientSharedPtr contentClient, WorkQueueInterface *workQueue) KZ_OVERRIDE See AbstractService::initialize.
-
void
instantiateRegisteredContentProviders()¶ Instantiates all registered content providers that has not yet been created.
- Note
This should not be required to call at runtime but is a conviency method invoked when Kanzi Studio needs to know all possible content providers.
-
void invalidateContent (const string &uri, const ContentInvalidationInfo &data) KZ_OVERRIDE See ContentInterface::invalidateContent.
-
void notifyChanged (const string &uri) KZ_OVERRIDE See ContentInterface::notifyChanged.
Same as registerContentProvider but also creates the provider immediately.
- Return
created content provider instance
- Parameters
domain: Domain URI that is covered by this content provider.creator: Factory creator function that instantiates such content provider type.
-
void registerContent (const string &uri, const string &schema) KZ_OVERRIDE See ContentInterface::registerContent.
Registers content provider to system.
- Parameters
domain: Domain URI that is covered by this content provider.creator: Factory creator function that instantiates such content provider type.
Removes existing content provider from system.
- Parameters
contentProvider: Content provider instance to remove.
-
void
removePendingQuery(unsigned int queryId)¶ Unregisters remote query from the system.
Should be called when query is finished.
- Parameters
queryId: Unique identifier for the query.
-
void respond (const int &uid, const QueryResponseData &arg) KZ_OVERRIDE See ContentInterface::respond.
-
void returnCredits (const string &uri, const int &credits) KZ_OVERRIDE See ContentInterface::returnCredits.
-
void subscribe (const QueryArgumentData &arg) KZ_OVERRIDE See ContentInterface::subscribe.
-
bool
subscribe(const QueryArgumentData &arg, ContentResultCallback callback, ContentInvalidationCallback invalidationCallback)¶ Subscribe to content, allows to receive a callback when content subscription is updated.
-
string subscribeRuntimeData (const string &uri) KZ_OVERRIDE No description given.
-
string
subscribeRuntimeData(const string &uri, RuntimeDataContentResultCallback callback)¶ Subscribes to runtime data.
- Return
Specification of the routing rules in XML format.
- Parameters
uri: The URI at which to subscribe.callback: The callback to invoke on subscription.
Subscribes to runtime data.
- Return
Specification of the routing rules in XML format.
- Parameters
session: session for runtime datauri: The URI at which to subscribe.callback: The callback to invoke on subscription.
-
void uninitialize () KZ_OVERRIDE See AbstractService::uninitialize.
-
void unregisterContent (const string &uri) KZ_OVERRIDE See ContentInterface::unregisterContent.
-
void unsubscribe (const string &uri) KZ_OVERRIDE See ContentInterface::unsubscribe.
Give a diagnostics manager functionality for content manager to use.
-
void work (ConnectWorkItemSharedPtr work) KZ_OVERRIDE See AbstractService::work.
-
typedef function<void(const string &uri, int reason, int startRow, int endRow)>