qpid::client::Connection Class Reference
[Application API for an AMQP client.]

Represents a connection to an AMQP broker. More...

#include <Connection.h>

Inheritance diagram for qpid::client::Connection:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Connection (framing::ProtocolVersion=framing::highestProtocolVersion)
 Creates a connection object, but does not open the connection.
void open (const std::string &host, int port=5672, const std::string &uid="guest", const std::string &pwd="guest", const std::string &virtualhost="/", uint16_t maxFrameSize=65535)
 Opens a connection to a broker.
void open (const ConnectionSettings &settings)
 Opens a connection to a broker.
void close ()
 Close the connection.
void openChannel (Channel &)
 Associate a Channel with this connection and open it for use.
Session newSession (SynchronousMode sync, uint32_t detachedLifetime=0)
 Create a new session on this connection.
void resume (Session &session)
 Resume a suspended session.

Protected Attributes

boost::shared_ptr< ConnectionImpl > impl


Detailed Description

Represents a connection to an AMQP broker.

All communication is initiated by establishing a connection, then opening one or more Channels over that connection.


Constructor & Destructor Documentation

qpid::client::Connection::Connection ( framing::ProtocolVersion  = framing::highestProtocolVersion  ) 

Creates a connection object, but does not open the connection.

Parameters:
_version the version of the protocol to connect with.


Member Function Documentation

void qpid::client::Connection::open ( const std::string &  host,
int  port = 5672,
const std::string &  uid = "guest",
const std::string &  pwd = "guest",
const std::string &  virtualhost = "/",
uint16_t  maxFrameSize = 65535 
)

Opens a connection to a broker.

Parameters:
host the host on which the broker is running.
port the port on the which the broker is listening.
uid the userid to connect with.
pwd the password to connect with (currently SASL PLAIN is the only authentication method supported so this is sent in clear text).
virtualhost the AMQP virtual host to use (virtual hosts, where implemented(!), provide namespace partitioning within a single broker).

Referenced by BrokerFixture::open().

void qpid::client::Connection::open ( const ConnectionSettings settings  ) 

Opens a connection to a broker.

Parameters:
the settings to use (host, port etc)
See also:
ConnectionSettings

void qpid::client::Connection::close (  ) 

Close the connection.

Any further use of this connection (without reopening it) will not succeed.

void qpid::client::Connection::openChannel ( Channel  ) 

Associate a Channel with this connection and open it for use.

In AMQP, channels are like multiplexed 'sessions' of work over a connection. Almost all the interaction with AMQP is done over a channel.

Parameters:
connection the connection object to be associated with the channel. Call Channel::close() to close the channel.

Session qpid::client::Connection::newSession ( SynchronousMode  sync,
uint32_t  detachedLifetime = 0 
)

Create a new session on this connection.

Sessions allow multiple streams of work to be multiplexed over the same connection.

Parameters:
detachedLifetime,: A session may be detached from its channel, either by calling Session::suspend() or because of a network failure. The session state is preserved for detachedLifetime seconds to allow a call to resume(). After that the broker may discard the session state. Default is 0, meaning the session cannot be resumed.

void qpid::client::Connection::resume ( Session session  ) 

Resume a suspended session.

A session may be resumed on a different connection to the one that created it.


The documentation for this class was generated from the following file:

Generated on Thu May 15 22:24:02 2008 for Qpid by  doxygen 1.5.5