Infinity.XmppManager

g GObject.Object GObject.Object Infinity.XmppManager Infinity.XmppManager GObject.Object->Infinity.XmppManager

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_connection (connection)

contains_connection (connection)

lookup_connection_by_address (address, port)

lookup_connection_by_hostname (hostname, service, srv)

remove_connection (connection)

Virtual Methods

Inherited:

GObject.Object (7)

do_connection_added (connection)

do_connection_removed (connection, replaced_by)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

connection-added

This signal is emitted whenever a new connection has been added to the Infinity.XmppManager, via Infinity.XmppManager.add_connection().

connection-removed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Infinity.XmppManager(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Infinity.XmppManagerClass

Infinity.XmppManager is an opaque data type. You should only access it via the public API functions.

classmethod new()
Returns:

A new Infinity.XmppManager.

Return type:

Infinity.XmppManager

Creates a new xmpp manager.

add_connection(connection)
Parameters:

connection (Infinity.XmppConnection) – A Infinity.XmppConnection not yet contained in self.

Adds the given connection to self so that it is found by Infinity.XmppManager.lookup_connection_by_address(), Infinity.XmppManager.lookup_connection_by_hostname() and Infinity.XmppManager.contains_connection().

contains_connection(connection)
Parameters:

connection (Infinity.XmppConnection) – A Infinity.XmppConnection.

Returns:

True if connection is contained in self, False otherwise.

Return type:

bool

Returns whether connection is contained in self.

lookup_connection_by_address(address, port)
Parameters:
Returns:

A Infinity.XmppConnection with the given address and port, or None if not found.

Return type:

Infinity.XmppConnection or None

Looks for a Infinity.XmppConnection contained in self whose underlaying Infinity.TcpConnection has the given address and port set. Returns None if there is no such connection.

This function may also return a closed connection. You can then attempt to reopen it, or remove it from the manager using Infinity.XmppManager.remove_connection() when that fails.

lookup_connection_by_hostname(hostname, service, srv)
Parameters:
  • hostname (str) – The remote hostname to look for.

  • service (str or None) – The service string of the connection to look for.

  • srv (str or None) – The SRV record corresponding to the connection.

Returns:

A Infinity.XmppConnection with the given hostname, service and srv, or None if not found.

Return type:

Infinity.XmppConnection or None

Looks for a Infinity.XmppConnection contained in self whose underlaying Infinity.TcpConnection has a Infinity.NameResolver with the given properties.

This function may also return a closed connection. You can then attempt to reopen it, or remove it from the manager using Infinity.XmppManager.remove_connection() when that fails.

remove_connection(connection)
Parameters:

connection (Infinity.XmppConnection) – A Infinity.XmppConnection contained in self.

Removes the given connection from self.

do_connection_added(connection) virtual
Parameters:

connection (Infinity.XmppConnection) –

do_connection_removed(connection, replaced_by) virtual
Parameters:

Signal Details

Infinity.XmppManager.signals.connection_added(xmpp_manager, connection)
Signal Name:

connection-added

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a new connection has been added to the Infinity.XmppManager, via Infinity.XmppManager.add_connection().

Infinity.XmppManager.signals.connection_removed(xmpp_manager, object, p0)
Signal Name:

connection-removed

Flags:

RUN_LAST

Parameters: