Tracker.Notifier¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
SPARQL connection |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Notifies of changes in the Tracker database. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Tracker.Notifier(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
TrackerNotifier
allows receiving notification on changes in the data stored by a [class`Tracker`.SparqlConnection].This object may be created through [method`Tracker`.SparqlConnection.create_notifier], events can then be listened for by connecting to the [signal`Tracker`.Notifier::events] signal.
Not every change is notified, only RDF resources with a class that has the nrl:notify property defined by the ontology will be notified upon changes.
Database changes are communicated through [struct`Tracker`.NotifierEvent] events on individual graph/resource pairs. The event type obtained through [method`Tracker`.NotifierEvent.get_event_type] will determine the type of event. Insertion of new resources is notified through
Tracker.NotifierEventType.CREATE
events, deletion of resources is notified throughTracker.NotifierEventType.DELETE
events, and changes on any property of the resource is notified throughTracker.NotifierEventType.UPDATE
events.The events happen in reaction to database changes, after a
TrackerNotifier
received an event of typeTracker.NotifierEventType.DELETE
, the resource will not exist anymore and only the information in the [struct`Tracker`.NotifierEvent] will remain.Similarly, when receiving an event of type
Tracker.NotifierEventType.UPDATE
, the resource will have already changed, so the data previous to the update is no longer available.The [signal`Tracker`.Notifier::events] signal is emitted in the thread-default main context of the thread where the
TrackerNotifier
instance was created.- signal_subscribe(connection, service, object_path, graph)¶
- Parameters:
- Returns:
An ID for this subscription
- Return type:
Listens to notification events from a remote DBus SPARQL endpoint.
If connection refers to a message bus (system/session), service must refer to a D-Bus name (either unique or well-known). If connection is a non-message bus (e.g. a peer-to-peer D-Bus connection) the service argument may be
None
.If the object_path argument is
None
, the default/org/freedesktop/Tracker3/Endpoint
path will be used. If graph isNone
, all graphs will be listened for.The signal subscription can be removed with [method`Tracker`.Notifier.signal_unsubscribe].
Note that this call is not necessary to receive notifications on a connection obtained through [ctor`Tracker`.SparqlConnection.bus_new], only to listen to update notifications from additional DBus endpoints.
Signal Details¶
- Tracker.Notifier.signals.events(notifier, service, graph, events)¶
- Signal Name:
events
- Flags:
- Parameters:
notifier (
Tracker.Notifier
) – The object which received the signalservice (
str
) – The SPARQL service that originated the events,None
for the local storegraph (
str
) – The graph where the events happened on,None
for the default anonymous graphevents ([
Tracker.NotifierEvent
]) – A [type`GLib`.PtrArray] of [struct`Tracker`.NotifierEvent]
Notifies of changes in the Tracker database.
Property Details¶
- Tracker.Notifier.props.connection¶
- Name:
connection
- Type:
- Default Value:
- Flags:
SPARQL connection to listen to.