ContentSubscription¶
-
class
kanzi::connect::ContentSubscription: public ContentProvider::Observer, public enable_shared_from_this<ContentSubscription>¶ A class that represents one content query that was received by the Content Manager.
Public Types
-
typedef function<void(const string &uri, int reason, int startRow, int endRow)>
ContentInvalidationCallback¶ Callback function for content invalidation.
-
typedef function<void(const string &uri, ContentDataSharedPtr data)>
ContentResultCallback¶ Callback function for content result.
Public Functions
Constructor.
- Parameters
session: Session that initiated the content query.uri: Complete content URI for the query.contentUri: Content table in the encapsulated database.columns: Table columns for the database projection.filter: ‘Where’ clause for filtering output rows.limit: ‘Limit’ clause for selecting output rows.sort: ‘Order by’ clause for sorting output rows.callback: Callback for content result, invoked whenever content subscription is updated.invalidationCallback: Callback for content invalidation notification.
Builds a content subscription object.
- Parameters
session: the sessionargs: query argumentscallback: for content result, invoked whenever subscription is updated.invalidationCallback: Callback for content invalidation notification.
-
~ContentSubscription()¶ Destructor.
-
const vector<string> &
getColumns() const¶ Retrieve Table columns for the database projection.
- Return
Table columns for the database projection.
-
const string &
getContentUri() const¶ Retrieve content table in the encapsulated database.
- Return
Content table in the encapsulated database.
-
shared_ptr<ContentServiceConcept::Session>
getSession() const¶ Retrieve the session that initiated the query.
- Return
Session that initiated the query.
-
const string &
getUri() const¶ Retrieve complete content URI for the content query.
- Return
Content URI for the query.
-
void
onChanged(ContentProvider *provider, const string &uri, bool) override¶ See ContentProvider::Observer::onChanged.
-
void
onInvalidated(ContentProvider *provider, const string &uri, int reason, int startRow, int endRow) override¶ Callback to notify invalidation of content provider.
- Parameters
provider: Content provider that changed.reason: the reason for invalidation. Not currently used.beginRow: inclusive start row of the change. Not currently used.endRow: inclusive end row of the change. Not currently used.
-
void
update(ContentProvider *provider)¶ Asks the content subscription to update.
Causes it to re-perform the content query.
- Parameters
provider: Content provider that manages data for this subscription.
Configures diagnostics data sink to be used by the class.
-
typedef function<void(const string &uri, int reason, int startRow, int endRow)>