Home | Trees | Index | Help |
|
---|
|
JabberClient
Base class for an XMPP-IM client.
This class does not provide any JSF extensions to the XMPP protocol, including legacy authentication methods.
Method Summary | |
---|---|
Initialize a Client object. | |
Handle "authenticated" event. | |
Handle "authorized" event. | |
Connect to the server and set up the stream. | |
Handle "connected" event. | |
Disconnect from the server. | |
Handle "disconnected" event. | |
socket.socket |
Get the socket object of the active connection. |
pyxmpp.ClientStream |
Get the connected stream object. |
Do some "housekeeping" work like cache expiration or timeout handling. | |
Simple "main loop" for the client. | |
Request the user's roster. | |
Request an IM session. | |
Handle roster update event. | |
Handle session started event. | |
Handle stream closure event. | |
Handle stream creation event. | |
Handle stream error received. | |
Handle any stream state change. | |
Process roster request failure. | |
Process a "roster push" (change notification) received. | |
Process roster request success. | |
Process roster request time out. | |
Process session request failure. | |
Process session request success. | |
Process session request time out. | |
Handle stream state changes. |
Instance Variable Summary | |
---|---|
list of str |
auth_methods : methods allowed for stream authentication. |
pyxmpp.JID |
jid : configured JID of the client (current actual JID
is avialable as self.stream.jid ). |
int |
keepalive : keepalive interval for the stream or 0 when keepalive is
disabled. |
threading.RLock |
lock : lock for synchronizing Client attributes access. |
unicode |
password : authentication password. |
int |
port : port number on the server to use if non-standard and not
discoverable by SRV lookups. |
pyxmpp.Roster |
roster : user's roster or None if the roster is not yet retrieved. |
unicode |
server : server to use if non-standard and not discoverable
by SRV lookups. |
bool |
session_established : True when an IM session is established. |
threading.Condition |
state_changed : condition notified the the object state changes
(stream becomes connected, session established etc.). |
pyxmpp.ClientStream |
stream : current stream when the client is connected,
None otherwise. |
Method Details |
---|
__init__(self,
jid=None,
password=None,
server=None,
port=5222,
auth_methods=('sasl:DIGEST-MD5',),
tls_settings=None,
keepalive=0)
Initialize a Client object. |
authenticated(self)Handle "authenticated" event. May be overriden in derived classes. This one does nothing. |
authorized(self)Handle "authorized" event. May be overriden in derived classes. This one requests an IM session. |
connect(self, register=False)Connect to the server and set up the stream. Set |
connected(self)Handle "connected" event. May be overriden in derived classes. This one does nothing. |
disconnect(self)Disconnect from the server. |
disconnected(self)Handle "disconnected" event. May be overriden in derived classes. This one does nothing. |
get_socket(self)Get the socket object of the active connection.
|
get_stream(self)Get the connected stream object.
|
idle(self)Do some "housekeeping" work like cache expiration or timeout handling. Should be called periodically from the application main loop. May be overriden in derived classes. |
loop(self, timeout=1)Simple "main loop" for the client. By default just call the This usually will be replaced by something more sophisticated. E.g. handling of other input sources. |
request_roster(self)Request the user's roster. |
request_session(self)Request an IM session. |
roster_updated(self, item=None)Handle roster update event. May be overriden in derived classes. This one does nothing.
|
session_started(self)Handle session started event. May be overriden in derived classes. This one sends the initial presence and requests the user's roster. |
stream_closed(self, stream)Handle stream closure event. May be overriden in derived classes. This one does nothing.
|
stream_created(self, stream)Handle stream creation event. May be overriden in derived classes. This one does nothing.
|
stream_error(self, err)Handle stream error received. May be overriden in derived classes. This one passes an error messages to logging facilities.
|
stream_state_changed(self, state, arg)Handle any stream state change. May be overriden in derived classes. This one does nothing.
|
__roster_error(self, iq)Process roster request failure.
|
__roster_push(self, iq)Process a "roster push" (change notification) received.
|
__roster_result(self, iq)Process roster request success.
|
__roster_timeout(self)Process roster request time out.
|
__session_error(self, iq)Process session request failure.
|
__session_result(self, _unused)Process session request success.
|
__session_timeout(self)Process session request time out.
|
__stream_state_change(self, state, arg)Handle stream state changes. Call apopriate methods of self.
|
Instance Variable Details |
---|
auth_methodsmethods allowed for stream authentication. SASL mechanism names should be preceded with "sasl:" prefix.
|
jidconfigured JID of the client (current actual JID is avialable asself.stream.jid ).
|
keepalivekeepalive interval for the stream or 0 when keepalive is disabled.
|
locklock for synchronizingClient attributes access.
|
passwordauthentication password.
|
portport number on the server to use if non-standard and not discoverable by SRV lookups.
|
rosteruser's roster orNone if the roster is not yet retrieved.
|
serverserver to use if non-standard and not discoverable by SRV lookups.
|
session_establishedTrue when an IM session is established.
|
state_changedcondition notified the the object state changes (stream becomes connected, session established etc.).
|
streamcurrent stream when the client is connected,None otherwise.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Dec 26 17:57:29 2005 | http://epydoc.sf.net |