Package xmpp :: Module roster :: Class Roster
[show private | hide private]
[frames | no frames]

Class Roster

PlugIn --+
         |
        Roster


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.
Method Summary
  __init__(self)
Init internal variables.
  __getitem__(self, item)
Get the contact in the internal format.
  Authorize(self, jid)
Authorise JID 'jid'.
  delItem(self, jid)
Delete contact 'jid' from roster.
  getAsk(self, jid)
Returns 'ask' value of contact 'jid'.
  getGroups(self, jid)
Returns groups list that contact 'jid' belongs to.
  getItem(self, item)
Get the contact in the internal format (or None if JID 'item' is not in roster).
  getItems(self)
Return list of all [bare] JIDs that the roster is currently tracks.
  getName(self, jid)
Returns name of contact 'jid'.
  getPriority(self, jid)
Returns priority of contact 'jid'.
  getRawItem(self, jid)
Returns roster item 'jid' representation in internal format.
  getRawRoster(self)
Returns roster representation in internal format.
  getResources(self, jid)
Returns list of connected resources of contact 'jid'.
  getRoster(self)
Requests roster from server if neccessary and returns self.
  getShow(self, jid)
Returns 'show' value of contact 'jid'.
  getStatus(self, jid)
Returns 'status' value of contact 'jid'.
  getSubscription(self, jid)
Returns 'subscription' value of contact 'jid'.
  keys(self)
Same as getItems.
  plugin(self, owner, request)
Register presence and subscription trackers in the owner's dispatcher.
  PresenceHandler(self, dis, pres)
Presence tracker.
  Request(self, force)
Request roster from server if it were not yet requested (or if the 'force' argument is set).
  RosterIqHandler(self, dis, stanza)
Subscription tracker.
  setItem(self, jid, name, groups)
Renames contact 'jid' and sets the groups list that it now belongs to.
  Subscribe(self, jid)
Send subscription request to JID 'jid'.
  Unauthorize(self, jid)
Unauthorise JID 'jid'.
  Unsubscribe(self, jid)
Ask for removing our subscription for JID 'jid'.
  _getItemData(self, jid, dataname)
Return specific jid's representation in internal format.
  _getResourceData(self, jid, dataname)
Return specific jid's resource representation in internal format.
    Inherited from PlugIn
  DEBUG(self, text, severity)
Feed a provided debug line to main instance's debug facility along with our ID string.
  PlugIn(self, owner)
Attach to main instance and register ourself and all our staff in it.
  PlugOut(self)
Unregister all our staff from main instance and detach from it.

Method Details

__init__(self)
(Constructor)

Init internal variables.
Overrides:
xmpp.client.PlugIn.__init__

__getitem__(self, item)
(Indexing operator)

Get the contact in the internal format. Raises KeyError if JID 'item' is not in roster.

Authorize(self, jid)

Authorise JID 'jid'. Works only if these JID requested auth previously.

delItem(self, jid)

Delete contact 'jid' from roster.

getAsk(self, jid)

Returns 'ask' value of contact 'jid'.

getGroups(self, jid)

Returns groups list that contact 'jid' belongs to.

getItem(self, item)

Get the contact in the internal format (or None if JID 'item' is not in roster).

getItems(self)

Return list of all [bare] JIDs that the roster is currently tracks.

getName(self, jid)

Returns name of contact 'jid'.

getPriority(self, jid)

Returns priority of contact 'jid'. 'jid' should be a full (not bare) JID.

getRawItem(self, jid)

Returns roster item 'jid' representation in internal format.

getRawRoster(self)

Returns roster representation in internal format.

getResources(self, jid)

Returns list of connected resources of contact 'jid'.

getRoster(self)

Requests roster from server if neccessary and returns self.

getShow(self, jid)

Returns 'show' value of contact 'jid'. 'jid' should be a full (not bare) JID.

getStatus(self, jid)

Returns 'status' value of contact 'jid'. 'jid' should be a full (not bare) JID.

getSubscription(self, jid)

Returns 'subscription' value of contact 'jid'.

keys(self)

Same as getItems. Provided for the sake of dictionary interface.

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.

PresenceHandler(self, dis, pres)

Presence tracker. Used internally for setting items' resources state in internal roster representation.

Request(self, force=0)

Request roster from server if it were not yet requested (or if the 'force' argument is set).

RosterIqHandler(self, dis, stanza)

Subscription tracker. Used internally for setting items state in internal roster representation.

setItem(self, jid, name=None, groups=[])

Renames contact 'jid' and sets the groups list that it now belongs to.

Subscribe(self, jid)

Send subscription request to JID 'jid'.

Unauthorize(self, jid)

Unauthorise JID 'jid'. Use for declining authorisation request or for removing existing authorization.

Unsubscribe(self, jid)

Ask for removing our subscription for JID 'jid'.

_getItemData(self, jid, dataname)

Return specific jid's representation in internal format. Used internally.

_getResourceData(self, jid, dataname)

Return specific jid's resource representation in internal format. Used internally.

Generated by Epydoc 2.1 on Sun Dec 26 09:52:56 2004 http://epydoc.sf.net