[Tracker] Discussing the API of libtracker-miner



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,
currently, we have a branch of tracker named libtracker-namer, which
includes a lib to be shared among all miners (if I got it right).
Currently, this lib includes a miner skeleton, and monitoring
functions. The idea would be to include more features in this lib,
merging the work I did for my gsoc project.
The miners I coded all connect to remote web services to pull data
like twitter status, flickr albums etc. They thus need to know about
the network status before initiating a sync (not mandatory, but it
prevents failing miserably). Also, they all need to store a token or
user/pass tuple to authenticate against the remote web service.

Therefore, I propose the additions of the following services to the lib :

1. Network status
Could use NetworkManager if available (we're not making a hard
dependency here) to know if the computer is connected to internet or
not. This would be abstracted with an interface to allow other network
providers (I think OpenSolaris for example uses something else).
NetworkStatus get_network_status ();
with NetworkStatus being an enum with 2 values, CONNECTED and
DISCONNECTED (better to put an enum here if ever we want to add more
values, for example to handle cases like 3G connections where data
transfers might be expensive for the user).

2. Tracker constants
Currently the fs miner hardcodes Tracker's DBus path. Wouldn't it be
simpler to put it in a shared header ?

3. Credentials storage
Note : this might not belong to libtracker-miner... Discussion is open!
To connect to the webservice, you generally need a token or a
user/pass tuple. Sometimes, you also need to store additionnal data,
so a simple user/pass API is not enough. Again, things should be
hidden by an interface.
I currently use something like (vala syntax) :
string get_password (string token_name, out HashTable<string, string>?
user_data) throws GLib.Error;
void forget_password (string token_name);
void store_password (string token_name, string password,
HashTable<string, string>? user_data) throws GLib.Error;

4. Configuration storage
It'd be nice for all the miners to have an easy API to store key/value
tuples. I've been told Martyn is working on it...

Thank you for your feedback !

Cheers

Adrien

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkqJmtkACgkQ8r/KOkHzAnE2ygCfbhVoXBQHurRsiUQkhSA6aJv+
0XYAn2DXhKre2I2N+zlA8OROCPCAx1rQ
=MgzQ
-----END PGP SIGNATURE-----




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]