Package pyxmpp2 :: Module interfaces :: Class XMPPTransport
[hide private]

Class XMPPTransport


Abstract base class for XMPP transport implementations.
Nested Classes [hide private]
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods [hide private]
 
set_target(self, stream)
Make the stream the target for this transport instance.
 
send_stream_head(self, stanza_namespace, stream_from, stream_to, stream_id=None, version=u'1.0', language=None)
Send stream head via the transport.
 
restart(self)
Restart the stream after SASL or StartTLS handshake.
 
send_stream_tail(self)
Send stream tail via the transport.
 
send_element(self, element)
Send an element via the transport.
 
is_connected(self)
Check if the transport is connected.
 
disconnect(self)
Gracefully disconnect the connection.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __abstractmethods__ = frozenset(['disconnect', 'is_connected',...
  _abc_cache = <_weakrefset.WeakSet object at 0x86c8e0c>
  _abc_negative_cache = <_weakrefset.WeakSet object at 0x86c8e4c>
  _abc_negative_cache_version = 10
  _abc_registry = <_weakrefset.WeakSet object at 0x86c8dac>
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

set_target(self, stream)

 

Make the stream the target for this transport instance.

The 'stream_start', 'stream_end' and 'stream_element' methods of the target will be called when appropriate content is received.

Parameters:
  • stream (StreamBase) - the stream handler to receive stream content from the transport
Decorators:
  • @abstractmethod

send_stream_head(self, stanza_namespace, stream_from, stream_to, stream_id=None, version=u'1.0', language=None)

 
Send stream head via the transport.
Parameters:
  • stanza_namespace (unicode) - namespace of stream stanzas (e.g. 'jabber:client')
  • stream_from (unicode) - the 'from' attribute of the stream. May be None.
  • stream_to (unicode) - the 'to' attribute of the stream. May be None.
  • version (unicode) - the 'version' of the stream.
  • language (unicode) - the 'xml:lang' of the stream
Decorators:
  • @abstractmethod

restart(self)

 

Restart the stream after SASL or StartTLS handshake.

For the initiator a new call to send_stream_head is required too.

Decorators:
  • @abstractmethod

send_stream_tail(self)

 
Send stream tail via the transport.
Decorators:
  • @abstractmethod

send_element(self, element)

 
Send an element via the transport.
Decorators:
  • @abstractmethod

is_connected(self)

 
Check if the transport is connected.
Returns:
True if is connected.
Decorators:
  • @abstractmethod

disconnect(self)

 
Gracefully disconnect the connection.
Decorators:
  • @abstractmethod

Class Variable Details [hide private]

__abstractmethods__

Value:
frozenset(['disconnect',
           'is_connected',
           'restart',
           'send_element',
           'send_stream_head',
           'send_stream_tail',
           'set_target'])