Top | ![]() |
![]() |
![]() |
![]() |
This is a documentation preview for the next version of Tracker, generated from tracker.git commit c585703.
See the Tracker website for more documentation.
TrackerNotifierEventType | tracker_notifier_event_get_event_type () |
gint64 | tracker_notifier_event_get_id () |
const gchar * | tracker_notifier_event_get_urn () |
guint | tracker_notifier_signal_subscribe () |
void | tracker_notifier_signal_unsubscribe () |
GBoxed ╰── TrackerNotifierEvent GEnum ╰── TrackerNotifierEventType GObject ╰── 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. This object was added in Tracker 1.12.
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.
TrackerNotifierEventType
tracker_notifier_event_get_event_type (TrackerNotifierEvent *event
);
Returns the event type.
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.
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:...".
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()
.
notifier |
||
connection |
a GDBusConnection |
|
service |
DBus service name to subscribe to events for |
|
object_path |
DBus object path to subscribe to events for, or |
[nullable] |
graph |
graph to listen events for, or |
[nullable] |
Since: 3.0
void 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
typedef struct _TrackerNotifier TrackerNotifier;
The TrackerNotifier object allows subscribing to changes in the stored data.
“connection”
property“connection” TrackerSparqlConnection *
SPARQL connection to listen to.
Owner: TrackerNotifier
Flags: Read / Write / Construct Only
“events”
signalvoid user_function (TrackerNotifier *self, char *service, char *graph, GPtrArray *events, gpointer user_data)
Notifies of changes in the Tracker database.
self |
The TrackerNotifier |
|
service |
The SPARQL service that originated the events, |
|
graph |
The graph where the events happened on, |
|
events |
A GPtrArray of TrackerNotifierEvent. |
[element-type TrackerNotifierEvent] |
user_data |
user data set when the signal handler was connected. |