Package pyxmpp2 :: Module binding :: Class ResourceBindingHandler
[hide private]

Class ResourceBindingHandler


Resource binding implementation.

Can handle only one stream at time.

To be used e.g. as one of the handlers passed to a client class constructor.

Nested Classes [hide private]

Inherited from interfaces.StreamFeatureHandler: __metaclass__

Instance Methods [hide private]
 
__init__(self, settings=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
make_stream_features(self, stream, features)
Add resource binding feature to the <features/> element of the stream.
 
handle_stream_features(self, stream, features)
Process incoming <stream:features/> element.
 
bind(self, stream, resource)
Bind to a resource.
 
_bind_success(self, stanza)
Handle resource binding success.
 
_bind_error(self, stanza)
Handle resource binding success.
 
handle_bind_iq_set(self, stanza)
Handler <iq type="set"/> for resource binding.

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

Class Variables [hide private]

Inherited from interfaces.StreamFeatureHandler: __abstractmethods__

Instance Variables [hide private]

Inherited from interfaces.XMPPFeatureHandler: stanza_processor

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, settings=None)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

make_stream_features(self, stream, features)

 

Add resource binding feature to the <features/> element of the stream.

[receving entity only]

Parameters:
  • stream - the stream
  • features - the features element about to be sent
Returns:
update <features/> element.
Overrides: interfaces.StreamFeatureHandler.make_stream_features

handle_stream_features(self, stream, features)

 

Process incoming <stream:features/> element.

[initiating entity only]

The received features element is available in features.

Parameters:
  • stream - the stream
  • features - the features element just received
Returns:
Overrides: interfaces.StreamFeatureHandler.handle_stream_features

bind(self, stream, resource)

 

Bind to a resource.

[initiating entity only]

XMPP stream is authenticated for bare JID only. To use the full JID it must be bound to a resource.

Parameters:
  • resource (unicode) - the resource name to bind to.

_bind_success(self, stanza)

 

Handle resource binding success.

[initiating entity only]

Set streambase.StreamBase.me to the full JID negotiated.

Parameters:
  • stanza - <iq type="result"/> stanza received.

_bind_error(self, stanza)

 

Handle resource binding success.

[initiating entity only]

Raises:

handle_bind_iq_set(self, stanza)

 
Handler <iq type="set"/> for resource binding.
Decorators:
  • @iq_set_stanza_handler(ResourceBindingPayload)