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.
- Returns
vector of content providers.
-
virtual ContentProviderCollectionSharedPtr getContentProvider () KZ_OVERRIDE
Returns the content provider collection that contains all registered content on server.
- Returns
Collection of content providers.
-
shared_ptr<RemoteQuery>
getPendingQuery
(unsigned int queryId) const¶ Retrieves pending remote query by it’s unique id.
- Parameters
queryId – Id of the query to retrieve.
- Returns
Resulting query object.
-
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.
- Returns
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().
- Returns
The signal.
-
virtual 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.
-
virtual void invalidateContent (const string &uri, const ContentInvalidationInfo &data) KZ_OVERRIDE
See ContentInterface::invalidateContent.
-
virtual void notifyChanged (const string &uri) KZ_OVERRIDE
See ContentInterface::notifyChanged.
Same as registerContentProvider but also creates the provider immediately.
- Parameters
domain – Domain URI that is covered by this content provider.
creator – Factory creator function that instantiates such content provider type.
- Returns
created content provider instance
-
virtual 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.
-
virtual void respond (const int &uid, const QueryResponseData &arg) KZ_OVERRIDE
See ContentInterface::respond.
-
virtual void returnCredits (const string &uri, const int &credits) KZ_OVERRIDE
See ContentInterface::returnCredits.
-
virtual void subscribe (const QueryArgumentData &arg) KZ_OVERRIDE
See ContentInterface::subscribe.
-
virtual bool
subscribe
(const QueryArgumentData &arg, ContentResultCallback callback, ContentInvalidationCallback invalidationCallback)¶ Subscribe to content, allows to receive a callback when content subscription is updated.
-
virtual string subscribeRuntimeData (const string &uri) KZ_OVERRIDE
No description given.
-
virtual string
subscribeRuntimeData
(const string &uri, RuntimeDataContentResultCallback callback)¶ Subscribes to runtime data.
- Parameters
uri – The URI at which to subscribe.
callback – The callback to invoke on subscription.
- Returns
Specification of the routing rules in XML format.
Subscribes to runtime data.
- Parameters
session – session for runtime data
uri – The URI at which to subscribe.
callback – The callback to invoke on subscription.
- Returns
Specification of the routing rules in XML format.
-
virtual void uninitialize () KZ_OVERRIDE
See AbstractService::uninitialize.
-
virtual void unregisterContent (const string &uri) KZ_OVERRIDE
See ContentInterface::unregisterContent.
-
virtual void unsubscribe (const string &uri) KZ_OVERRIDE
See ContentInterface::unsubscribe.
Give a diagnostics manager functionality for content manager to use.
-
virtual void work (ConnectWorkItemSharedPtr work) KZ_OVERRIDE
See AbstractService::work.
-
typedef function<void(const string &uri, int reason, int startRow, int endRow)>