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

Class Connection

source code


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

Instance Methods
Connection
__init__(self, url=None, **options)
Creates a connection.
source code
 
check_error(self) source code
 
get_error(self) source code
 
check_closed(self) source code
Session
session(self, name=None, transactional=False)
Creates or retrieves the named session.
source code
 
open(self, timeout=None)
Opens a connection.
source code
 
opened(self)
Return true if the connection is open, false otherwise.
source code
 
attach(self, timeout=None)
Attach to the remote endpoint.
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
Static Methods
 
establish(url=None, timeout=None, **options)
Constructs a Connection with the supplied parameters and opens it.
source code
Method Details

establish(url=None, timeout=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 opened with the Connection.open() 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) - the service name if needed by the SASL mechanism in use
  • sasl_min_ssf (int) - the minimum acceptable security strength factor
  • sasl_max_ssf (int) - the maximum acceptable security strength factor
  • reconnect (bool) - enable/disable automatic reconnect
  • reconnect_timeout (float) - total time to attempt reconnect
  • reconnect_interval_min (float) - minimum interval between reconnect attempts
  • reconnect_interval_max (float) - maximum interval between reconnect attempts
  • reconnect_interval (float) - 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
  • ssl_keyfile (str) - file with client's private key (PEM format)
  • ssl_certfile (str) - file with client's public (eventually priv+pub) key (PEM format)
  • ssl_trustfile (str) - file trusted certificates to validate the server
  • ssl_skip_hostname_check (bool) - disable verification of hostname in certificate. Use with caution - disabling hostname checking leaves you vulnerable to Man-in-the-Middle attacks.
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

open(self, timeout=None)

source code 

Opens a connection.

Decorators:
  • @synchronized

opened(self)

source code 

Return true if the connection is open, false otherwise.

Decorators:
  • @synchronized

attach(self, timeout=None)

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