Package nbxmpp :: Module roster_nb :: Class NonBlockingRoster |
[hide private]
[frames] | no frames]

# Class NonBlockingRoster

source code

Defines a plenty of methods that will allow you to manage roster. Also automatically track presences from remote JIDs taking into account that every JID can have multiple resources connected. Does not currently support 'error' presences. You can also use mapping interface for access to the internal representation of contacts in roster

Instance Methods | [hide private]
__init__(self, version=None) Init internal variables | source code
Request(self, force=0) Request roster from server if it were not yet requested (or if the 'force' argument is set) | source code
RosterIqHandler(self, dis, stanza) Subscription tracker. Used internally for setting items state in internal roster representation | source code
PresenceHandler(self, dis, pres) Presence tracker. Used internally for setting items' resources state in internal roster representation | source code
_getItemData(self, jid, dataname) Return specific jid's representation in internal format. Used internally | source code
_getResourceData(self, jid, dataname) Return specific jid's resource representation in internal format. Used internally | source code
delItem(self, jid) Delete contact 'jid' from roster | source code
getAsk(self, jid) Return 'ask' value of contact 'jid' | source code
getGroups(self, jid) Return groups list that contact 'jid' belongs to | source code
getName(self, jid) Return name of contact 'jid' | source code
getPriority(self, jid) Return priority of contact 'jid'. 'jid' should be a full (not bare) JID | source code
getRawRoster(self) Return roster representation in internal format | source code
getRawItem(self, jid) Return roster item 'jid' representation in internal format | source code
getShow(self, jid) Return 'show' value of contact 'jid'. 'jid' should be a full (not bare) JID | source code
getStatus(self, jid) Return 'status' value of contact 'jid'. 'jid' should be a full (not bare) JID | source code
getSubscription(self, jid) Return 'subscription' value of contact 'jid' | source code
getResources(self, jid) Return list of connected resources of contact 'jid' | source code
setItem(self, jid, name=None, groups=`[``]`) Rename contact 'jid' and sets the groups list that it now belongs to | source code
setItemMulti(self, items) Rename multiple contacts and sets their group lists | source code
getItems(self) Return list of all [bare] JIDs that the roster is currently tracks | source code
keys(self) Same as getItems. Provided for the sake of dictionary interface | source code
__getitem__(self, item) Get the contact in the internal format. Raises KeyError if JID 'item' is not in roster | source code
getItem(self, item) Get the contact in the internal format (or None if JID 'item' is not in roster) | source code
Subscribe(self, jid) Send subscription request to JID 'jid' | source code
Unsubscribe(self, jid) Ask for removing our subscription for JID 'jid' | source code
Authorize(self, jid) Authorize JID 'jid'. Works only if these JID requested auth previously | source code
Unauthorize(self, jid) Unauthorise JID 'jid'. Use for declining authorisation request or for removing existing authorization | source code
getRaw(self) Return the internal data representation of the roster | source code
setRaw(self, data) Return the internal data representation of the roster | source code
plugin(self, owner, request=1) Register presence and subscription trackers in the owner's dispatcher. Also request roster from server if the 'request' argument is set. Used internally | source code
_on_roster_set(self, data) | source code
getRoster(self, on_ready=None, force=False) Request roster from server if neccessary and returns self | source code
Inherited from `plugin.PlugIn`: `PlugIn`, `PlugOut`

Class Methods | [hide private]
Inherited from `plugin.PlugIn`: `get_instance`

Method Details | [hide private]

### __init__(self, version=None) (Constructor) | source code
Init internal variables Overrides: plugin.PlugIn.__init__

### Request(self, force=0) | source code
Request roster from server if it were not yet requested (or if the 'force' argument is set)

### RosterIqHandler(self, dis, stanza) | source code
Subscription tracker. Used internally for setting items state in internal roster representation

### PresenceHandler(self, dis, pres) | source code
Presence tracker. Used internally for setting items' resources state in internal roster representation

### _getItemData(self, jid, dataname) | source code
Return specific jid's representation in internal format. Used internally

### _getResourceData(self, jid, dataname) | source code
Return specific jid's resource representation in internal format. Used internally

### delItem(self, jid) | source code
Delete contact 'jid' from roster

### getAsk(self, jid) | source code
Return 'ask' value of contact 'jid'

### getGroups(self, jid) | source code
Return groups list that contact 'jid' belongs to

### getName(self, jid) | source code
Return name of contact 'jid'

### getPriority(self, jid) | source code
Return priority of contact 'jid'. 'jid' should be a full (not bare) JID

### getRawRoster(self) | source code
Return roster representation in internal format

### getRawItem(self, jid) | source code
Return roster item 'jid' representation in internal format

### getShow(self, jid) | source code
Return 'show' value of contact 'jid'. 'jid' should be a full (not bare) JID

### getStatus(self, jid) | source code
Return 'status' value of contact 'jid'. 'jid' should be a full (not bare) JID

### getSubscription(self, jid) | source code
Return 'subscription' value of contact 'jid'

### getResources(self, jid) | source code
Return list of connected resources of contact 'jid'

### setItem(self, jid, name=None, groups=`[``]`) | source code
Rename contact 'jid' and sets the groups list that it now belongs to

### setItemMulti(self, items) | source code
Rename multiple contacts and sets their group lists

### getItems(self) | source code
Return list of all [bare] JIDs that the roster is currently tracks

### keys(self) | source code
Same as getItems. Provided for the sake of dictionary interface

### __getitem__(self, item) (Indexing operator) | source code
Get the contact in the internal format. Raises KeyError if JID 'item' is not in roster

### getItem(self, item) | source code
Get the contact in the internal format (or None if JID 'item' is not in roster)

### Subscribe(self, jid) | source code
Send subscription request to JID 'jid'

### Unsubscribe(self, jid) | source code
Ask for removing our subscription for JID 'jid'

### Authorize(self, jid) | source code
Authorize JID 'jid'. Works only if these JID requested auth previously

### Unauthorize(self, jid) | source code
Unauthorise JID 'jid'. Use for declining authorisation request or for removing existing authorization

### getRaw(self) | source code
Return the internal data representation of the roster

### setRaw(self, data) | source code
Return the internal data representation of the roster

### plugin(self, owner, request=1) | source code
Register presence and subscription trackers in the owner's dispatcher. Also request roster from server if the 'request' argument is set. Used internally

### _on_roster_set(self, data) | source code

### getRoster(self, on_ready=None, force=False) | source code
Request roster from server if neccessary and returns self