Home | Trees | Index | Help |
|
---|
Package pyxmpp :: Package jabberd :: Module componentstream :: Class ComponentStream |
|
StanzaProcessor
--+ |StreamHandler
--+ |StreamBase
--+ |PasswordManager
--+ | | |StreamSASLMixIn
--+ |StreamTLSMixIn
--+ |Stream
--+ | ComponentStream
Handles jabberd component (jabber:component:accept) connection stream. :Ivariables: - `server`: server to use. - `port`: port number to use. - `secret`: authentication secret. :Types: - `server`: `unicode` - `port`: `int` - `secret`: `unicode`
Method Summary | |
---|---|
Initialize a `ComponentStream` object. | |
Accept an incoming component connection. | |
Establish a client connection to a server. | |
Process <stream:stream> (stream start) tag received from peer. | |
Authenticate on the server. | |
Compute the authentication handshake value. | |
Same as `ComponentStream.connect` but assume `self.lock` is acquired. | |
Initialize authentication when the connection is established and we are the initiator. | |
Process first level element of the stream. | |
Reset `ComponentStream` object state, making the object ready to handle new connections. | |
Inherited from Stream | |
Process incoming <stream:features/> element. | |
Create the <features/> element for the stream. | |
Inherited from StreamTLSMixIn | |
Get the TLS connection object for the stream. | |
Process incoming StartTLS related element of <stream:features/>. | |
Update the <features/> with StartTLS feature. | |
Initiate TLS connection. | |
Same as `Stream.process` but assume `self.lock` is acquired. | |
Process incoming stream element. | |
Process stream element in the TLS namespace. | |
Read data pending on the stream socket and pass it to the parser. | |
Read data pending on the stream socket and pass it to the parser. | |
Request a TLS-encrypted connection. | |
Reset `StreamTLSMixIn` object state making it ready to handle new connections. | |
Certificate verification callback for TLS connections. | |
Same as `Stream.write_raw` but assume `self.lock` is acquired. | |
Inherited from StreamSASLMixIn | |
Process incoming <stream:features/> element. | |
Add SASL features to the <features/> element of the stream. | |
Process incoming stream element. | |
Process incoming <sasl:abort/> element. | |
Process incoming <sasl:auth/> element. | |
Process incoming <sasl:challenge/> element. | |
Process incoming <sasl:failure/> element. | |
Process stream element in the SASL namespace. | |
Process incoming <sasl:response/> element. | |
Process incoming <sasl:success/> element. | |
Reset `StreamSASLMixIn` object state making it ready to handle new connections. | |
Start SASL authentication process. | |
Inherited from PasswordManager | |
Check if the authenticated entity is allowed to use given authorization id. | |
Check the password validity. | |
Choose an authentication realm from the list provided by the server. | |
Generate a random string for digest authentication challenges. | |
Get the password for user authentication. | |
Get available realms list. | |
Return the host name for DIGEST-MD5 'digest-uri' field. | |
Return the service name for DIGEST-MD5 'digest-uri' field. | |
Return the service type for DIGEST-MD5 'digest-uri' field. | |
Inherited from StreamBase | |
| |
Bind to a resource. | |
Check "to" attribute of received stream header. | |
Forcibly close the connection and clear the stream state. | |
Check if stream is connected. | |
Gracefully close the connection. | |
Handle stream XML parse error. | |
Return filedescriptor of the stream socket. | |
Generate a random and unique stream ID. | |
Do some housekeeping (cache expiration, timeout handling). | |
Simple "main loop" for the stream. | |
Single iteration of a simple "main loop" for the stream. | |
Process stream's pending events. | |
Process stream error element received. | |
Write stanza to the stream. | |
Process stanza (first level child element of the stream). | |
Process stanza (first level child element of the stream) start tag -- do nothing. | |
Called when connection state is changed. | |
Process </stream:stream> (stream end) tag received from peer. | |
Write raw data to the stream socket. | |
Same as `Stream.accept` but assume `self.lock` is acquired. | |
Handle resource binding success. | |
Handle resource binding success. | |
Same as `Stream.close` but assume `self.lock` is acquired. | |
Initialize stream on outgoing connection. | |
Same as `Stream.disconnect` but assume `self.lock` is acquired. | |
Feed the stream reader with data received. | |
Same as `Stream.idle` but assume `self.lock` is acquired. | |
Same as `Stream.loop_iter` but assume `self.lock` is acquired. | |
Create ne `xmlextra.StreamReader` instace as `self._reader`. | |
Called when connection is authenticated. | |
Process first level stream-namespaced element of the stream. | |
Restart the stream as needed after SASL and StartTLS negotiation. | |
Same as `Stream.send` but assume `self.lock` is acquired. | |
Send stream end tag. | |
Send stream error element. | |
Send stream <features/>. | |
Send stream start tag. | |
Write XML `xmlnode` to the stream. | |
Inherited from StanzaProcessor | |
Modify incoming stanza before processing it. | |
Modify outgoing stanza before sending into the stream. | |
Process IQ stanza received. | |
Process message stanza. | |
Process presence stanza. | |
Process stanza received from the stream. | |
Process stanza not addressed to us. | |
Set <iq type="get"/> handler. | |
Set <iq type="set"/> handler. | |
Set a handler for <message/> stanzas. | |
Set a handler for <presence/> stanzas. | |
Set response handler for an IQ "get" or "set" stanza. | |
Remove <iq type="get"/> handler. | |
Remove <iq type="set"/> handler. | |
Same as `Stream.set_response_handlers` but assume `self.lock` is acquired. | |
Inherited from StreamHandler | |
Process complete stanza. | |
Process stream end. | |
Process stream start. |
Method Details |
---|
__init__(self,
jid,
secret,
server,
port,
keepalive=0)
|
accept(self, sock)Accept an incoming component connection. [server only] :Parameters: - `sock`: a listening socket.
|
connect(self, server=None, port=None)Establish a client connection to a server. [component only] :Parameters: - `server`: name or address of the server to use. If not given then use the one specified when creating the object. - `port`: port number of the server to use. If not given then use the one specified when creating the object. :Types: - `server`: `unicode` - `port`: `int`
|
stream_start(self, doc)Process <stream:stream> (stream start) tag received from peer. Call `Stream.stream_start`, but ignore any `HostMismatch` error. :Parameters: - `doc`: document created by the parser
|
_auth(self)Authenticate on the server. [component only] |
_compute_handshake(self)Compute the authentication handshake value. :return: the computed hash value. :returntype: `str` |
_connect(self, server=None, port=None)Same as `ComponentStream.connect` but assume `self.lock` is acquired.
|
_post_connect(self)Initialize authentication when the connection is established and we are the initiator.
|
_process_node(self, node)Process first level element of the stream. Handle component handshake (authentication) element, and treat elements in "jabber:component:accept", "jabber:client" and "jabber:server" equally (pass to `self.process_stanza`). All other elements are passed to `Stream._process_node`. :Parameters: - `node`: XML node describing the element
|
_reset(self)Reset `ComponentStream` object state, making the object ready to handle new connections.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Wed May 31 22:37:01 2006 | http://epydoc.sf.net |