Package nbxmpp :: Module protocol :: Class JID |
[hide private]
[frames] | no frames]

# Class JID

source code

JID can be built from string, modified, compared, serialised into string

Instance Methods | [hide private]
__init__(self, jid=None, node=`'````'`, domain=`'````'`, resource=`'````'`) JID can be specified as string (jid argument) or as separate parts | source code
getNode(self) Return the node part of the JID | source code
setNode(self, node) Set the node part of the JID to new value. Specify None to remove the node part | source code
getDomain(self) Return the domain part of the JID | source code
setDomain(self, domain) Set the domain part of the JID to new value | source code
getResource(self) Return the resource part of the JID | source code
setResource(self, resource) Set the resource part of the JID to new value. Specify None to remove the resource part | source code
getStripped(self) Return the bare representation of JID. I.e. string value w/o resource | source code
__eq__(self, other) Compare the JID to another instance or to string for equality | source code
__ne__(self, other) Compare the JID to another instance or to string for non-equality | source code
bareMatch(self, other) Compare the node and domain parts of the JID's for equality | source code
__str__(self, wresource=1) Serialise JID into string | source code
__hash__(self) Produce hash of the JID, Allows to use JID objects as keys of the dictionary | source code

Method Details | [hide private]

### __init__(self, jid=None, node=`'````'`, domain=`'````'`, resource=`'````'`) (Constructor) | source code
JID can be specified as string (jid argument) or as separate parts Examples: JID('node@domain/resource') JID(node='node',domain='domain.org')

### getNode(self) | source code
Return the node part of the JID

### setNode(self, node) | source code
Set the node part of the JID to new value. Specify None to remove the node part

### getDomain(self) | source code
Return the domain part of the JID

### setDomain(self, domain) | source code
Set the domain part of the JID to new value

### getResource(self) | source code
Return the resource part of the JID

### setResource(self, resource) | source code
Set the resource part of the JID to new value. Specify None to remove the resource part

### getStripped(self) | source code
Return the bare representation of JID. I.e. string value w/o resource

### __eq__(self, other) (Equality operator) | source code
Compare the JID to another instance or to string for equality

### __ne__(self, other) | source code
Compare the JID to another instance or to string for non-equality

### bareMatch(self, other) | source code
Compare the node and domain parts of the JID's for equality

### __str__(self, wresource=1) (Informal representation operator) | source code
Serialise JID into string

### __hash__(self) (Hashing function) | source code
Produce hash of the JID, Allows to use JID objects as keys of the dictionary