Package qpid :: Package messaging :: Module endpoints :: Class Connection
[hide private]
[frames] | no frames]

Class Connection

source code

Endpoint --+
           |
          Connection

A Connection manages a group of Sessions and connects them with a remote endpoint.

Instance Methods [hide private]
Connection
__init__(self, url=None, **options)
Creates a connection.
source code
 
_wait(self, predicate, timeout=None) source code
 
_wakeup(self) source code
 
check_error(self) source code
 
get_error(self) source code
 
_ewait(self, predicate, timeout=None) source code
 
check_closed(self) source code
Session
session(self, name=None, transactional=False)
Creates or retrieves the named session.
source code
 
_remove_session(self, ssn) source code
 
open(self)
Opens a connection.
source code
 
opened(self)
Return true if the connection is open, false otherwise.
source code
 
attach(self)
Attach to the remote endpoint.
source code
 
_unlinked(self) source code
 
detach(self, timeout=None)
Detach from the remote endpoint.
source code
 
attached(self)
Return true if the connection is attached, false otherwise.
source code
 
close(self, timeout=None)
Close the connection and all sessions.
source code

Inherited from Endpoint (private): _ecwait

Static Methods [hide private]
 
establish(url=None, **options)
Constructs a Connection with the supplied parameters and opens it.
source code
Method Details [hide private]

establish(url=None, **options)
Static Method

source code 

Constructs a Connection with the supplied parameters and opens it.

Decorators:
  • @static

__init__(self, url=None, **options)
(Constructor)

source code 

Creates a connection. A newly created connection must be connected with the Connection.connect() method before it can be used.

Parameters:
  • url (str) - [ <username> [ / <password> ] @ ] <host> [ : <port> ]
  • host (str) - the name or ip address of the remote host (overriden by url)
  • port (int) - the port number of the remote host (overriden by url)
  • transport (str) - one of tcp, tcp+tls, or ssl (alias for tcp+tls)
  • heartbeat (int) - heartbeat interval in seconds
  • username (str) - the username for authentication (overriden by url)
  • password (str) - the password for authentication (overriden by url)
  • sasl_mechanisms (str) - space separated list of permitted sasl mechanisms
  • sasl_service (str) - ???
  • sasl_min_ssf (???) - ???
  • sasl_max_ssf (???) - ???
  • reconnect (bool) - enable/disable automatic reconnect
  • reconnect_timeout (float) - total time to attempt reconnect
  • reconnect_internal_min (float) - minimum interval between reconnect attempts
  • reconnect_internal_max (float) - maximum interval between reconnect attempts
  • reconnect_interval - set both min and max reconnect intervals
  • reconnect_limit (int) - limit the total number of reconnect attempts
  • reconnect_urls (list[str]) - list of backup hosts specified as urls
  • address_ttl (float) - time until cached address resolution expires
  • reconnect_internal (float)
Returns: Connection
a disconnected Connection

session(self, name=None, transactional=False)

source code 

Creates or retrieves the named session. If the name is omitted or None, then a unique name is chosen based on a randomly generated uuid.

Parameters:
  • name (str) - the session name
Returns: Session
the named Session
Decorators:
  • @synchronized

_remove_session(self, ssn)

source code 
Decorators:
  • @synchronized

open(self)

source code 

Opens a connection.

Decorators:
  • @synchronized

opened(self)

source code 

Return true if the connection is open, false otherwise.

Decorators:
  • @synchronized

attach(self)

source code 

Attach to the remote endpoint.

Decorators:
  • @synchronized

detach(self, timeout=None)

source code 

Detach from the remote endpoint.

Decorators:
  • @synchronized

attached(self)

source code 

Return true if the connection is attached, false otherwise.

Decorators:
  • @synchronized

close(self, timeout=None)

source code 

Close the connection and all sessions.

Decorators:
  • @synchronized