core: added getEntitiesData which get cache data for several entities at once

This commit is contained in:
Goffi 2015-02-09 21:39:51 +01:00
commit ec25ba82e1
2 changed files with 84 additions and 3 deletions

View file

@ -270,6 +270,12 @@ class DbusObject(dbus.service.Object):
def getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
return self._callback("getContactsFromGroup", unicode(group), unicode(profile_key))
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='asass', out_signature='a{sa{ss}}',
async_callbacks=None)
def getEntitiesData(self, jids, keys, profile):
return self._callback("getEntitiesData", jids, keys, unicode(profile))
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='sass', out_signature='a{ss}',
async_callbacks=None)

View file

@ -184,12 +184,24 @@ type=method
category=core
sig_in=sass
sig_out=a{ss}
doc=Get data for an entity
doc=Get data in cache for an entity
doc_param_0=jid: entity's bare jid
doc_param_1=keys: list of keys to get
doc_param_2=%(doc_profile)s
doc_return=dictionary of asked key,
if key doesn't exist, the resulting dictionary will neither have the key
if key doesn't exist, the resulting dictionary will not have the key
[getEntitiesData]
type=method
category=core
sig_in=asass
sig_out=a{sa{ss}}
doc=Get data in cache for several entities at once
doc_param_0=jids: list of entities bare jid, or empty list to have all jids in cache
doc_param_1=keys: list of keys to get
doc_param_2=%(doc_profile)s
doc_return=dictionary with jids as keys and dictionary of asked key as values
if key doesn't exist for a jid, the resulting dictionary will not have it
[asyncCreateProfile]
async=