class documentation

class XmlStream(xmlstream.XmlStream): (source)

View In Hierarchy

XMPP XML Stream protocol handler.
Method __init__ Undocumented
Method connection​Made Called when a connection is made.
Method on​Document​Start Called when the stream header has been received.
Method on​Stream​Error Called when a stream:error element has been received.
Method reset Reset XML Stream.
Method send Send data over the stream.
Method send​Footer Send stream footer.
Method send​Header Send stream header.
Method send​Stream​Error Send stream level error.
Instance Variable authenticator associated authenticator that uses initializers to initialize the XML stream.
Instance Variable features map of (uri, name) to stream features element received from the receiving entity.
Instance Variable initializers list of stream initializer objects
Instance Variable initiating True if this is the initiating stream
Instance Variable namespace default namespace URI for stream
Instance Variable other​Entity JID of the peer entity
Instance Variable prefixes map of URI to prefixes that are to appear on stream header.
Instance Variable sid session identifier
Instance Variable this​Entity JID of this entity
Instance Variable version XML stream version as a tuple (major, minor). Initially, this is set to the minimally supported version. Upon receiving the stream header of the peer, it is set to the minimum of that value and the version on the received header.
Method _call​Later Undocumented
Instance Variable _header​Sent Undocumented

Inherited from XmlStream:

Method connection​Lost Called when the connection is shut down.
Method data​Received Called whenever data is received.
Method on​Document​End Called whenever the end tag of the root element has been received.
Method on​Element Called whenever a direct child element of the root element has been received.
Method reset​Dispatch​Fn Set the default function (onElement) to handle elements.
Method set​Dispatch​Fn Set another function to handle elements.
Instance Variable raw​Data​In​Fn Undocumented
Instance Variable raw​Data​Out​Fn Undocumented
Instance Variable stream Undocumented
Method _initialize​Stream Sets up XML Parser.

Inherited from Protocol (via XmlStream):

Method log​Prefix Return a prefix matching the class name, to identify log messages related to this protocol instance.
Class Variable factory Undocumented

Inherited from BaseProtocol (via XmlStream, Protocol):

Method make​Connection Make a connection to a transport and a server.
Instance Variable connected Undocumented
Instance Variable transport Undocumented

Inherited from EventDispatcher (via XmlStream):

Method add​Observer Register an observer for an event.
Method add​Onetime​Observer Register a one-time observer for an event.
Method dispatch Dispatch an event.
Method remove​Observer Remove callable as observer for an event.
Instance Variable prefix Undocumented
Method _add​Observer Undocumented
Method _get​Event​And​Observers Undocumented
Instance Variable _dispatch​Depth Undocumented
Instance Variable _event​Observers Undocumented
Instance Variable _update​Queue Undocumented
Instance Variable _xpath​Observers Undocumented
def __init__(self, authenticator): (source)
def connectionMade(self): (source)

Called when a connection is made.

Notifies the authenticator when a connection has been made.

def onDocumentStart(self, rootElement): (source)

Called when the stream header has been received.

Extracts the header's id and version attributes from the root element. The id attribute is stored in our sid attribute and the version attribute is parsed and the minimum of the version we sent and the parsed version attribute is stored as a tuple (major, minor) in this class' version attribute. If no version attribute was present, we assume version 0.0.

If appropriate (we are the initiating stream and the minimum of our and the other party's version is at least 1.0), a one-time observer is registered for getting the stream features. The registered function is onFeatures.

Ultimately, the authenticator's streamStarted method will be called.

Parameters
root​Element:domish.ElementThe root element.
def onStreamError(self, errelem): (source)

Called when a stream:error element has been received.

Dispatches a STREAM_ERROR_EVENT event with the error element to allow for cleanup actions and drops the connection.

Parameters
errelem:domish.ElementThe received error element.
def reset(self): (source)

Reset XML Stream.

Resets the XML Parser for incoming data. This is to be used after successfully negotiating a new layer, e.g. TLS and SASL. Note that registered event observers will continue to be in place.

def send(self, obj): (source)

Send data over the stream.

This overrides xmlstream.XmlStream.send to use the default namespace of the stream header when serializing domish.IElements. It is assumed that if you pass an object that provides domish.IElement, it represents a direct child of the stream's root element.

def sendFooter(self): (source)
Send stream footer.
def sendHeader(self): (source)
Send stream header.
def sendStreamError(self, streamError): (source)

Send stream level error.

If we are the receiving entity, and haven't sent the header yet, we sent one first.

After sending the stream error, the stream is closed and the transport connection dropped.

Parameters
stream​Error:error.StreamErrorstream error instance
authenticator = (source)
associated authenticator that uses initializers to initialize the XML stream.
features: dict of (unicode, unicode) to domish.Element. = (source)
map of (uri, name) to stream features element received from the receiving entity.
initializers: list of objects that provide IInitializer = (source)
list of stream initializer objects
initiating: bool = (source)
True if this is the initiating stream
namespace: unicode = (source)
default namespace URI for stream
otherEntity: JID = (source)
JID of the peer entity
prefixes: dict of unicode to unicode = (source)
map of URI to prefixes that are to appear on stream header.
sid: unicode = (source)
session identifier
thisEntity: JID = (source)
JID of this entity
version: (int, int) = (source)
XML stream version as a tuple (major, minor). Initially, this is set to the minimally supported version. Upon receiving the stream header of the peer, it is set to the minimum of that value and the version on the received header.
def _callLater(self, *args, **kwargs): (source)

Undocumented

_headerSent: bool = (source)

Undocumented