TrackerNotifier
TrackerNotifier is an object that receives notifications about changes to the Tracker database. A TrackerNotifier is created through tracker_sparql_connection_create_notifier, after the notifier is created, events can be listened for by connecting to the events signal.
Known caveats
- The TRACKER_NOTIFIER_EVENT_DELETE events will be received after the resource has been deleted. At that time queries on those elements will not bring any metadata. Only the ID/URN obtained through the event remain meaningful.
- Notifications of files being moved across indexed folders will appear as TRACKER_NOTIFIER_EVENT_UPDATE events, containing the new location (if requested). The older location is no longer known to Tracker, this may make tracking of elements in specific folders hard using solely the TrackerNotifier/Tracker data available at event notification time.
TrackerNotifier
GObject
╰──TrackerNotifier
The
Members
parent_instance
(GObject)
–
Class structure
TrackerNotifierClass
Tracker.NotifierClass
Tracker.NotifierClass
Tracker.Notifier
GObject.Object
╰──Tracker.Notifier
The
Members
parent_instance
(GObject.Object)
–
Tracker.Notifier
GObject.Object
╰──Tracker.Notifier
The
Members
parent_instance
(GObject.Object)
–
Methods
tracker_notifier_signal_subscribe
guint tracker_notifier_signal_subscribe (TrackerNotifier * notifier, GDBusConnection* connection, const gchar* service, const gchar* object_path, const gchar* graph)
Listens to notification events from a remote SPARQL endpoint as a DBus service (see TrackerEndpointDBus). If the object_path argument is NULL, the default "/org/freedesktop/Tracker3/Endpoint" path will be used. If graph is NULL, all graphs will be listened for.
The signal subscription can be removed with tracker_notifier_signal_unsubscribe.
Parameters:
notifier
–
connection
–
a GDBusConnection
service
–
DBus service name to subscribe to events for
object_path
(
[nullable])
–
DBus object path to subscribe to events for, or NULL
graph
(
[nullable])
–
graph to listen events for, or NULL
An ID for this subscription
Since : 3.0
Tracker.Notifier.prototype.signal_subscribe
function Tracker.Notifier.prototype.signal_subscribe(connection: Gio.DBusConnection, service: String, object_path: String, graph: String): {
// javascript wrapper for 'tracker_notifier_signal_subscribe'
}
Listens to notification events from a remote SPARQL endpoint as a DBus service (see Tracker.EndpointDBus). If the object_path argument is NULL, the default "/org/freedesktop/Tracker3/Endpoint" path will be used. If graph is NULL, all graphs will be listened for.
The signal subscription can be removed with Tracker.Notifier.prototype.signal_unsubscribe.
Parameters:
connection
(Gio.DBusConnection)
–
a GDBusConnection
DBus service name to subscribe to events for
DBus object path to subscribe to events for, or NULL
graph to listen events for, or NULL
An ID for this subscription
Since : 3.0
Tracker.Notifier.signal_subscribe
def Tracker.Notifier.signal_subscribe (self, connection, service, object_path, graph):
#python wrapper for 'tracker_notifier_signal_subscribe'
Listens to notification events from a remote SPARQL endpoint as a DBus service (see Tracker.EndpointDBus). If the object_path argument is NULL, the default "/org/freedesktop/Tracker3/Endpoint" path will be used. If graph is NULL, all graphs will be listened for.
The signal subscription can be removed with Tracker.Notifier.signal_unsubscribe.
Parameters:
connection
(Gio.DBusConnection)
–
a GDBusConnection
DBus service name to subscribe to events for
DBus object path to subscribe to events for, or NULL
graph to listen events for, or NULL
An ID for this subscription
Since : 3.0
tracker_notifier_signal_unsubscribe
tracker_notifier_signal_unsubscribe (TrackerNotifier * notifier, guint handler_id)
Undoes a DBus signal subscription, the handler_id argument was previously obtained with a tracker_notifier_signal_subscribe call.
Since : 3.0
Tracker.Notifier.prototype.signal_unsubscribe
function Tracker.Notifier.prototype.signal_unsubscribe(handler_id: Number): {
// javascript wrapper for 'tracker_notifier_signal_unsubscribe'
}
Undoes a DBus signal subscription, the handler_id argument was previously obtained with a Tracker.Notifier.prototype.signal_subscribe call.
Since : 3.0
Tracker.Notifier.signal_unsubscribe
def Tracker.Notifier.signal_unsubscribe (self, handler_id):
#python wrapper for 'tracker_notifier_signal_unsubscribe'
Undoes a DBus signal subscription, the handler_id argument was previously obtained with a Tracker.Notifier.signal_subscribe call.
Since : 3.0
Signals
events
events_callback (TrackerNotifier * self, gchar* service, gchar* graph, TrackerNotifierEvent * events, gpointer user_data)
Notifies of changes in the Tracker database.
Parameters:
self
–
The TrackerNotifier
service
–
The SPARQL service that originated the events, NULL for the local store
graph
–
The graph where the events happened on, NULL for the default anonymous graph
events
(
[element-typeTrackerNotifierEvent])
–
A GPtrArray of TrackerNotifierEvent
user_data
–
Flags:
events
function events_callback(self: Tracker.Notifier, service: String, graph: String, events: [ Tracker.NotifierEvent ], user_data: Object): {
// javascript callback for the 'events' signal
}
Notifies of changes in the Tracker database.
Parameters:
The Tracker.Notifier
The SPARQL service that originated the events, NULL for the local store
The graph where the events happened on, NULL for the default anonymous graph
A GPtrArray of Tracker.NotifierEvent
Flags:
events
def events_callback (self, service, graph, events, *user_data):
#python callback for the 'events' signal
Notifies of changes in the Tracker database.
Parameters:
The Tracker.Notifier
The SPARQL service that originated the events, NULL for the local store
The graph where the events happened on, NULL for the default anonymous graph
A GPtrArray of Tracker.NotifierEvent
Flags:
Properties
connection
“connection” TrackerSparqlConnection *
SPARQL connection to listen to.
Flags : Read / Write / Construct Only
connection
“connection” Tracker.SparqlConnection
SPARQL connection to listen to.
Flags : Read / Write / Construct Only
connection
“self.props.connection” Tracker.SparqlConnection
SPARQL connection to listen to.
Flags : Read / Write / Construct Only
TrackerNotifierEvent
The
Tracker.NotifierEvent
The
Tracker.NotifierEvent
The
Methods
tracker_notifier_event_get_event_type
TrackerNotifierEventType tracker_notifier_event_get_event_type (TrackerNotifierEvent * event)
Returns the event type.
Parameters:
event
–
The event type
Tracker.NotifierEvent.prototype.get_event_type
function Tracker.NotifierEvent.prototype.get_event_type(): {
// javascript wrapper for 'tracker_notifier_event_get_event_type'
}
Returns the event type.
Parameters:
The event type
Tracker.NotifierEvent.get_event_type
def Tracker.NotifierEvent.get_event_type (self):
#python wrapper for 'tracker_notifier_event_get_event_type'
Returns the event type.
Parameters:
The event type
tracker_notifier_event_get_id
gint64 tracker_notifier_event_get_id (TrackerNotifierEvent * event)
Returns the tracker:id of the element being notified upon. This is a gint64 which is used as efficient internal identifier for the resource.
Parameters:
event
–
the resource ID
Tracker.NotifierEvent.prototype.get_id
function Tracker.NotifierEvent.prototype.get_id(): {
// javascript wrapper for 'tracker_notifier_event_get_id'
}
Returns the tracker:id of the element being notified upon. This is a gint64 which is used as efficient internal identifier for the resource.
Parameters:
the resource ID
Tracker.NotifierEvent.get_id
def Tracker.NotifierEvent.get_id (self):
#python wrapper for 'tracker_notifier_event_get_id'
Returns the tracker:id of the element being notified upon. This is a gint64 which is used as efficient internal identifier for the resource.
Parameters:
the resource ID
tracker_notifier_event_get_urn
const gchar* tracker_notifier_event_get_urn (TrackerNotifierEvent * event)
Returns the Uniform Resource Name of the element. This is Tracker's public identifier for the resource.
This URN is an unique string identifier for the resource being notified upon, typically of the form "urn:uuid:...".
Parameters:
event
–
The element URN
Tracker.NotifierEvent.prototype.get_urn
function Tracker.NotifierEvent.prototype.get_urn(): {
// javascript wrapper for 'tracker_notifier_event_get_urn'
}
Returns the Uniform Resource Name of the element. This is Tracker's public identifier for the resource.
This URN is an unique string identifier for the resource being notified upon, typically of the form "urn:uuid:...".
Parameters:
The element URN
Tracker.NotifierEvent.get_urn
def Tracker.NotifierEvent.get_urn (self):
#python wrapper for 'tracker_notifier_event_get_urn'
Returns the Uniform Resource Name of the element. This is Tracker's public identifier for the resource.
This URN is an unique string identifier for the resource being notified upon, typically of the form "urn:uuid:...".
Parameters:
The element URN
Enumerations
TrackerNotifierEventType
Notifier event types.
Members
TRACKER_NOTIFIER_EVENT_CREATE
(0)
–
An element was created.
TRACKER_NOTIFIER_EVENT_DELETE
(1)
–
An element was deleted.
TRACKER_NOTIFIER_EVENT_UPDATE
(2)
–
An element was updated.
Tracker.NotifierEventType
Notifier event types.
Members
Tracker.NotifierEventType.CREATE
(0)
–
An element was created.
Tracker.NotifierEventType.DELETE
(1)
–
An element was deleted.
Tracker.NotifierEventType.UPDATE
(2)
–
An element was updated.
Tracker.NotifierEventType
Notifier event types.
Members
Tracker.NotifierEventType.CREATE
(0)
–
An element was created.
Tracker.NotifierEventType.DELETE
(1)
–
An element was deleted.
Tracker.NotifierEventType.UPDATE
(2)
–
An element was updated.
The results of the search are