A class that acts as a content service that is an interface for all database content on server. More...
#include <content_manager.hpp>
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. More... | |
| typedef function< ContentProvider *(WorkQueueInterface *workQueue)> | CreationFunction |
| Creator function type for content providers. More... | |
| typedef map< string, shared_ptr< ContentProvider > > | ProviderContainer |
| typedef ProviderContainer::iterator | ProviderContainerIterator |
| typedef function< void(const string &uri, RuntimeDataObjectSharedPtr data)> | RuntimeDataContentResultCallback |
Public Member Functions | |
| void | addContentProvider (const string &uri, ContentProviderSharedPtr contentProvider) |
| Adds existing content provider to system. More... | |
| void | addPendingQuery (unsigned int queryId, shared_ptr< RemoteQuery > query) |
| Registers remote query to the system. More... | |
| ContentManager (ConnectDomain *domain) | |
| Constructor. More... | |
| vector< ContentProviderSharedPtr > | getAllKnownContentProviders () |
| Retrieves all known content providers. More... | |
| virtual ContentProviderCollectionSharedPtr | getContentProvider () KZ_OVERRIDE |
| Returns the content provider collection that contains all registered content on server. More... | |
| shared_ptr< RemoteQuery > | getPendingQuery (unsigned int queryId) const |
| Retrieves pending remote query by it's unique id. More... | |
| WorkQueueInterface * | getProxyWorkQueue () |
| Returns a proxied work queue instance that can be used by composited classes to to assign work to this service. More... | |
| WorkQueueInterface * | getWorkQueue () const |
| Access to signal that allows to invoke work(). More... | |
| virtual void | initialize (InterfaceDomainBase *domain, ContentClientSharedPtr contentClient, WorkQueueInterface *workQueue) KZ_OVERRIDE |
| See AbstractService::initialize. More... | |
| void | instantiateRegisteredContentProviders () |
| Instantiates all registered content providers that has not yet been created. More... | |
| virtual void | invalidateContent (const string &uri, const ContentInvalidationInfo &data) KZ_OVERRIDE |
| See ContentInterface::invalidateContent. More... | |
| virtual void | notifyChanged (const string &uri) KZ_OVERRIDE |
| See ContentInterface::notifyChanged. More... | |
| template<class _T > | |
| shared_ptr< _T > | registerAndCreateContentProvider (const string &domain, shared_ptr< ContentProviderCreator > creator) |
| Same as registerContentProvider but also creates the provider immediately. More... | |
| virtual void | registerContent (const string &uri, const string &schema) KZ_OVERRIDE |
| See ContentInterface::registerContent. More... | |
| void | registerContentProvider (const string &domain, shared_ptr< ContentProviderCreator > creator) |
| Registers content provider to system. More... | |
| void | removeContentProvider (ContentProviderSharedPtr contentProvider) |
| Removes existing content provider from system. More... | |
| void | removePendingQuery (unsigned int queryId) |
| Unregisters remote query from the system. More... | |
| virtual void | respond (const int &uid, const QueryResponseData &arg) KZ_OVERRIDE |
| See ContentInterface::respond. More... | |
| virtual void | returnCredits (const string &uri, const int &credits) KZ_OVERRIDE |
| See ContentInterface::returnCredits. More... | |
| virtual void | subscribe (const QueryArgumentData &arg) KZ_OVERRIDE |
| See ContentInterface::subscribe. More... | |
| virtual bool | subscribe (const QueryArgumentData &arg, ContentResultCallback callback, ContentInvalidationCallback invalidationCallback) |
| Subscribe to content, allows to receive a callback when content subscription is updated. More... | |
| virtual bool | subscribe (shared_ptr< ContentServiceConcept::Session > session, const QueryArgumentData &arg, ContentResultCallback callback, ContentInvalidationCallback invalidationCallback) |
| virtual string | subscribeRuntimeData (const string &uri) KZ_OVERRIDE |
| No description given. More... | |
| virtual string | subscribeRuntimeData (const string &uri, RuntimeDataContentResultCallback callback) |
| Subscribes to runtime data. More... | |
| virtual string | subscribeRuntimeData (shared_ptr< ContentServiceConcept::Session > session, const string &uri, RuntimeDataContentResultCallback callback) |
| Subscribes to runtime data. More... | |
| virtual void | uninitialize () KZ_OVERRIDE |
| See AbstractService::uninitialize. More... | |
| virtual void | unregisterContent (const string &uri) KZ_OVERRIDE |
| See ContentInterface::unregisterContent. More... | |
| virtual void | unsubscribe (const string &uri) KZ_OVERRIDE |
| See ContentInterface::unsubscribe. More... | |
| virtual void | unsubscribe (shared_ptr< ContentServiceConcept::Session > session, const string &uri) |
| void | useDiagnosticsManager (DiagnosticsManagerSharedPtr diagnostics) |
| Give a diagnostics manager functionality for content manager to use. More... | |
| virtual void | work (ConnectWorkItemSharedPtr work) KZ_OVERRIDE |
| See AbstractService::work. More... | |
| ~ContentManager () | |
| Destructor. More... | |
Public Member Functions inherited from kanzi::connect::VirtualFileProvider | |
| virtual | ~VirtualFileProvider () |
| Virtual destructor for cleanup. More... | |
Protected Member Functions | |
| shared_ptr< ContentProvider > | createContentProvider (const string &uri) |
| Instantiates and initializes new content provider for given uri. More... | |
| HTTPContentRequestSharedPtr | createContentRequest (const string &id) |
| Creates a content request originating from HTTP. More... | |
| void | destroyContentProvider (ContentProvider *provider) |
| Uninitializes and destroys an existing content provider. More... | |
| string | handleContentSchemaRequest (const string &id) |
| Handles a content provider specific schema request. More... | |
| void | initializeFilePathRegistrations () |
| Initialize file provider functionality. More... | |
| virtual void | onReleaseSession (AbstractSessionSharedPtr session) KZ_OVERRIDE |
| See AbstractService::onReleaseSession. More... | |
| void | uninitializeFilePathRegistrations () |
| Uninitialize file provider functionality. More... | |
| void | unregisterRemoteContents () |
| Cleans up remote content providers away from the system when session is terminated for a client. More... | |
| void | unregisterRemoteContents (shared_ptr< ContentServiceConcept::Session > session) |
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.
| typedef function<void(const string& uri, int reason, int startRow, int endRow)> kanzi::connect::ContentManager::ContentInvalidationCallback |
| typedef function<void(const string& uri, ContentDataSharedPtr data)> kanzi::connect::ContentManager::ContentResultCallback |
Callback function for content result.
| typedef function<ContentProvider*(WorkQueueInterface* workQueue)> kanzi::connect::ContentManager::CreationFunction |
Creator function type for content providers.
| typedef map<string, shared_ptr<ContentProvider> > kanzi::connect::ContentManager::ProviderContainer |
| typedef ProviderContainer::iterator kanzi::connect::ContentManager::ProviderContainerIterator |
| typedef function<void(const string& uri, RuntimeDataObjectSharedPtr data)> kanzi::connect::ContentManager::RuntimeDataContentResultCallback |
| kanzi::connect::ContentManager::ContentManager | ( | ConnectDomain * | domain | ) |
Constructor.
| kanzi::connect::ContentManager::~ContentManager | ( | ) |
Destructor.
| void kanzi::connect::ContentManager::addContentProvider | ( | const string & | uri, |
| ContentProviderSharedPtr | contentProvider | ||
| ) |
Adds existing content provider to system.
| uri | URI that is covered by this content provider. |
| contentProvider | Content provider instance to add to system. |
| void kanzi::connect::ContentManager::addPendingQuery | ( | unsigned int | queryId, |
| shared_ptr< RemoteQuery > | query | ||
| ) |
Registers remote query to the system.
Allows to wait for remote content provider to respond.
| queryId | Unique identifier for the query. |
| query | Query to register. |
|
protected |
Instantiates and initializes new content provider for given uri.
| uri | Domain uri of the content provider. |
|
protected |
Creates a content request originating from HTTP.
| id | the uri containing first the service identifier, then possible table information and finally possible arguments for the query. Example com.rightware.content/songs?columns=id,name&limit=10 |
|
protected |
Uninitializes and destroys an existing content provider.
| provider | Content provider to destroy. |
| vector<ContentProviderSharedPtr> kanzi::connect::ContentManager::getAllKnownContentProviders | ( | ) |
Retrieves all known content providers.
|
virtual |
Returns the content provider collection that contains all registered content on server.
| shared_ptr<RemoteQuery> kanzi::connect::ContentManager::getPendingQuery | ( | unsigned int | queryId | ) | const |
Retrieves pending remote query by it's unique id.
| queryId | Id of the query to retrieve. |
| WorkQueueInterface* kanzi::connect::ContentManager::getProxyWorkQueue | ( | ) |
Returns a proxied work queue instance that can be used by composited classes to to assign work to this service.
| WorkQueueInterface* kanzi::connect::ContentManager::getWorkQueue | ( | ) | const |
Access to signal that allows to invoke work().
|
protected |
Handles a content provider specific schema request.
| id | the content provider identifier as uri. Example com.rightware.content/songs |
|
virtual |
|
protected |
Initialize file provider functionality.
| void kanzi::connect::ContentManager::instantiateRegisteredContentProviders | ( | ) |
Instantiates all registered content providers that has not yet been created.
|
virtual |
See ContentInterface::invalidateContent.
|
virtual |
See ContentInterface::notifyChanged.
|
protectedvirtual |
|
inline |
Same as registerContentProvider but also creates the provider immediately.
| domain | Domain URI that is covered by this content provider. |
| creator | Factory creator function that instantiates such content provider type. |
|
virtual |
See ContentInterface::registerContent.
| void kanzi::connect::ContentManager::registerContentProvider | ( | const string & | domain, |
| shared_ptr< ContentProviderCreator > | creator | ||
| ) |
Registers content provider to system.
| domain | Domain URI that is covered by this content provider. |
| creator | Factory creator function that instantiates such content provider type. |
| void kanzi::connect::ContentManager::removeContentProvider | ( | ContentProviderSharedPtr | contentProvider | ) |
Removes existing content provider from system.
| contentProvider | Content provider instance to remove. |
| void kanzi::connect::ContentManager::removePendingQuery | ( | unsigned int | queryId | ) |
Unregisters remote query from the system.
Should be called when query is finished.
| queryId | Unique identifier for the query. |
|
virtual |
See ContentInterface::respond.
|
virtual |
See ContentInterface::returnCredits.
|
virtual |
See ContentInterface::subscribe.
|
virtual |
Subscribe to content, allows to receive a callback when content subscription is updated.
|
virtual |
|
virtual |
No description given.
|
virtual |
Subscribes to runtime data.
| uri | The URI at which to subscribe. |
| callback | The callback to invoke on subscription. |
|
virtual |
Subscribes to runtime data.
| session | session for runtime data |
| uri | The URI at which to subscribe. |
| callback | The callback to invoke on subscription. |
|
virtual |
|
protected |
Uninitialize file provider functionality.
|
virtual |
See ContentInterface::unregisterContent.
|
protected |
Cleans up remote content providers away from the system when session is terminated for a client.
| session | Session that was terminated. |
|
protected |
|
virtual |
See ContentInterface::unsubscribe.
|
virtual |
| void kanzi::connect::ContentManager::useDiagnosticsManager | ( | DiagnosticsManagerSharedPtr | diagnostics | ) |
Give a diagnostics manager functionality for content manager to use.
|
virtual |