Apache Qpid C++ API
Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation

qpid::messaging::Session Class Reference

A session represents a distinct 'conversation' which can involve sending and receiving messages to and from different addresses. More...

#include <qpid/messaging/Session.h>

List of all members.

Public Member Functions

 Session (SessionImpl *impl=0)
 Session (const Session &)
 ~Session ()
Sessionoperator= (const Session &)
void close ()
void commit ()
void rollback ()
void acknowledge ()
 Acknowledges all outstanding messages that have been received by the application on this session.
void reject (Message &)
 Rejects the specified message.
void sync ()
void flush ()
uint32_t available ()
 Returns the number of messages received and waiting to be fetched.
uint32_t pendingAck ()
 Returns a count of the number of messages received this session that have been acknowledged, but for which that acknowledgement has not yet been confirmed as processed by the server.
bool nextReceiver (Receiver &, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE)
 Retrieves the receiver for the next available message.
Receiver nextReceiver (qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE)
 Returns the receiver for the next available message.
Sender createSender (const Address &address)
 Create a new sender through which messages can be sent to the specified address.
Sender createSender (const std::string &address)
Receiver createReceiver (const Address &address)
 Create a new receiver through which messages can be received from the specified address.
Receiver createReceiver (const std::string &address)
Sender getSender (const std::string &name) const
 Returns the sender with the specified name or throws KeyError if there is none for that name.
Receiver getReceiver (const std::string &name) const
 Returns the receiver with the specified name or throws KeyError if there is none for that name.
Connection getConnection () const
 Returns a handle to the connection this session is associated with.
bool isValid () const
bool isNull () const
 operator bool () const
 Conversion to bool supports idiom if (handle) { handle->.
bool operator! () const
 Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
void swap (Handle< SessionImpl > &h)

Protected Types

typedef SessionImpl Impl

Protected Attributes

Implimpl

Detailed Description

A session represents a distinct 'conversation' which can involve sending and receiving messages to and from different addresses.

Definition at line 57 of file Session.h.


Member Typedef Documentation

typedef SessionImpl qpid::client::Handle< SessionImpl >::Impl [protected, inherited]

Definition at line 57 of file Handle.h.


Constructor & Destructor Documentation

qpid::messaging::Session::Session ( SessionImpl *  impl = 0  ) 
qpid::messaging::Session::Session ( const Session  ) 
qpid::messaging::Session::~Session (  ) 

Member Function Documentation

void qpid::messaging::Session::acknowledge (  ) 

Acknowledges all outstanding messages that have been received by the application on this session.

uint32_t qpid::messaging::Session::available (  ) 

Returns the number of messages received and waiting to be fetched.

void qpid::messaging::Session::close (  ) 
void qpid::messaging::Session::commit (  ) 
Receiver qpid::messaging::Session::createReceiver ( const std::string &  address  ) 
Receiver qpid::messaging::Session::createReceiver ( const Address address  ) 

Create a new receiver through which messages can be received from the specified address.

Sender qpid::messaging::Session::createSender ( const std::string &  address  ) 
Sender qpid::messaging::Session::createSender ( const Address address  ) 

Create a new sender through which messages can be sent to the specified address.

void qpid::messaging::Session::flush (  ) 
Connection qpid::messaging::Session::getConnection (  )  const

Returns a handle to the connection this session is associated with.

Receiver qpid::messaging::Session::getReceiver ( const std::string &  name  )  const

Returns the receiver with the specified name or throws KeyError if there is none for that name.

Sender qpid::messaging::Session::getSender ( const std::string &  name  )  const

Returns the sender with the specified name or throws KeyError if there is none for that name.

bool qpid::client::Handle< SessionImpl >::isNull (  )  const [inline, inherited]
Returns:
true if handle is null. It is an error to call any function on a null handle.

Definition at line 46 of file Handle.h.

References qpid::client::Handle< T >::impl.

bool qpid::client::Handle< SessionImpl >::isValid (  )  const [inline, inherited]
Returns:
true if handle is valid, i.e. not null.

Definition at line 43 of file Handle.h.

References qpid::client::Handle< T >::impl.

Receiver qpid::messaging::Session::nextReceiver ( qpid::sys::Duration  timeout = qpid::sys::TIME_INFINITE  ) 

Returns the receiver for the next available message.

If there are no available messages at present the call will block for up to the specified timeout waiting for one to arrive. Will throw Receiver::NoMessageAvailable if no message became available in time.

bool qpid::messaging::Session::nextReceiver ( Receiver ,
qpid::sys::Duration  timeout = qpid::sys::TIME_INFINITE 
)

Retrieves the receiver for the next available message.

If there are no available messages at present the call will block for up to the specified timeout waiting for one to arrive. Returns true if a message was available at the point of return, in which case the passed in receiver reference will be set to the receiver for that message or fals if no message was available.

qpid::client::Handle< SessionImpl >::operator bool (  )  const [inline, inherited]

Conversion to bool supports idiom if (handle) { handle->.

.. }

Definition at line 49 of file Handle.h.

References qpid::client::Handle< T >::impl.

bool qpid::client::Handle< SessionImpl >::operator! (  )  const [inline, inherited]

Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.

Definition at line 52 of file Handle.h.

References qpid::client::Handle< T >::impl.

Session& qpid::messaging::Session::operator= ( const Session  ) 
uint32_t qpid::messaging::Session::pendingAck (  ) 

Returns a count of the number of messages received this session that have been acknowledged, but for which that acknowledgement has not yet been confirmed as processed by the server.

void qpid::messaging::Session::reject ( Message  ) 

Rejects the specified message.

This will prevent the message being redelivered.

void qpid::messaging::Session::rollback (  ) 
void qpid::client::Handle< SessionImpl >::swap ( Handle< SessionImpl > &  h  )  [inline, inherited]

Definition at line 54 of file Handle.h.

References qpid::client::Handle< T >::impl.

void qpid::messaging::Session::sync (  ) 

Member Data Documentation

Impl* qpid::client::Handle< SessionImpl >::impl [protected, inherited]

Definition at line 64 of file Handle.h.


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

Qpid C++ API Reference
Generated on Tue May 4 14:28:25 2010 for Qpid C++ Client API by doxygen 1.6.2-20100208