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

qpid::client::Subscription Class Reference

A handle to an active subscription. More...

#include <Subscription.h>

Inherits qpid::client::Handle< T >< qpid::client::SubscriptionImpl >.

List of all members.

Public Member Functions

 Subscription (SubscriptionImpl *si=0)
std::string getName () const
 The name of the subsctription, used as the "destination" for messages from the broker.
std::string getQueue () const
 Name of the queue this subscription subscribes to.
const SubscriptionSettingsgetSettings () const
 Get the flow control and acknowledgement settings for this subscription.
void setFlowControl (const FlowControl &)
 Set the flow control parameters.
void setAutoAck (unsigned int n)
 Automatically acknowledge (acquire and accept) batches of n messages.
SequenceSet getUnacquired () const
 Get the set of ID's for messages received by this subscription but not yet acquired.
SequenceSet getUnaccepted () const
 Get the set of ID's for messages received by this subscription but not yet accepted.
void acquire (const SequenceSet &messageIds)
 Acquire messageIds and remove them from the unacquired set.
void accept (const SequenceSet &messageIds)
 Accept messageIds and remove them from the unaccepted set.
void release (const SequenceSet &messageIds)
 Release messageIds and remove them from the unaccepted set.
void acquire (const Message &m)
void accept (const Message &m)
void release (const Message &m)
Session getSession () const
 Get the session associated with this subscription.
SubscriptionManagergetSubscriptionManager () const
 Get the subscription manager associated with this subscription.
void cancel ()
 Cancel the subscription.
void grantMessageCredit (uint32_t)
 Grant the specified amount of message credit.
void grantByteCredit (uint32_t)
 Grant the specified amount of byte credit.
bool isValid () const
bool isNull () const
 operator bool () const
bool operator! () const
void swap (Handle< T > &)

Protected Attributes

T * impl


Detailed Description

A handle to an active subscription.

Provides methods to query the subscription status and control acknowledgement (acquire and accept) of messages.

Definition at line 40 of file Subscription.h.


Constructor & Destructor Documentation

qpid::client::Subscription::Subscription ( SubscriptionImpl si = 0  )  [inline]

Definition at line 42 of file Subscription.h.


Member Function Documentation

void qpid::client::Subscription::accept ( const Message m  )  [inline]

Definition at line 91 of file Subscription.h.

References accept(), and qpid::client::Message::getId().

void qpid::client::Subscription::accept ( const SequenceSet messageIds  ) 

Accept messageIds and remove them from the unaccepted set.

Precondition:
messageIds is a subset of getUnaccepted()

Referenced by accept().

void qpid::client::Subscription::acquire ( const Message m  )  [inline]

Definition at line 88 of file Subscription.h.

References acquire(), and qpid::client::Message::getId().

void qpid::client::Subscription::acquire ( const SequenceSet messageIds  ) 

Acquire messageIds and remove them from the unacquired set.

oAdd them to the unaccepted set if getSettings().acceptMode == ACCEPT_MODE_EXPLICIT.

Referenced by acquire().

void qpid::client::Subscription::cancel (  ) 

Cancel the subscription.

std::string qpid::client::Subscription::getName (  )  const

The name of the subsctription, used as the "destination" for messages from the broker.

Usually the same as the queue name but can be set differently.

std::string qpid::client::Subscription::getQueue (  )  const

Name of the queue this subscription subscribes to.

Session qpid::client::Subscription::getSession (  )  const

Get the session associated with this subscription.

const SubscriptionSettings& qpid::client::Subscription::getSettings (  )  const

Get the flow control and acknowledgement settings for this subscription.

SubscriptionManager& qpid::client::Subscription::getSubscriptionManager (  )  const

Get the subscription manager associated with this subscription.

SequenceSet qpid::client::Subscription::getUnaccepted (  )  const

Get the set of ID's for messages received by this subscription but not yet accepted.

SequenceSet qpid::client::Subscription::getUnacquired (  )  const

Get the set of ID's for messages received by this subscription but not yet acquired.

This will always be empty if getSettings().acquireMode=ACQUIRE_MODE_PRE_ACQUIRED

void qpid::client::Subscription::grantByteCredit ( uint32_t   ) 

Grant the specified amount of byte credit.

void qpid::client::Subscription::grantMessageCredit ( uint32_t   ) 

Grant the specified amount of message credit.

template<class T>
bool qpid::client::Handle< T >::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 45 of file Handle.h.

template<class T>
bool qpid::client::Handle< T >::isValid (  )  const [inline, inherited]

Returns:
true if handle is valid, i.e. not null.

Definition at line 42 of file Handle.h.

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

Definition at line 47 of file Handle.h.

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

Definition at line 48 of file Handle.h.

void qpid::client::Subscription::release ( const Message m  )  [inline]

Definition at line 94 of file Subscription.h.

References qpid::client::Message::getId(), and release().

void qpid::client::Subscription::release ( const SequenceSet messageIds  ) 

Release messageIds and remove them from the unaccepted set.

Precondition:
messageIds is a subset of getUnaccepted()

Referenced by release().

void qpid::client::Subscription::setAutoAck ( unsigned int  n  ) 

Automatically acknowledge (acquire and accept) batches of n messages.

You can disable auto-acknowledgement by setting n=0, and use acquire() and accept() to manually acquire and accept messages.

void qpid::client::Subscription::setFlowControl ( const FlowControl  ) 

Set the flow control parameters.

template<class T>
void qpid::client::Handle< T >::swap ( Handle< T > &   )  [inherited]

Definition at line 48 of file HandlePrivate.h.

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


Member Data Documentation

template<class T>
T* qpid::client::Handle< T >::impl [protected, inherited]

Definition at line 54 of file Handle.h.

Referenced by qpid::client::HandlePrivate< T >::get(), qpid::client::HandleAccess< T >::getImpl(), qpid::client::Handle< T >::Handle(), qpid::client::Handle< qpid::client::SubscriptionImpl >::isNull(), qpid::client::Handle< qpid::client::SubscriptionImpl >::isValid(), qpid::client::Handle< qpid::client::SubscriptionImpl >::operator bool(), qpid::client::Handle< qpid::client::SubscriptionImpl >::operator!(), qpid::client::Handle< T >::swap(), and qpid::client::Handle< T >::~Handle().


The documentation for this class was generated from the following file:
Qpid C++ API Reference
Generated on Tue Dec 8 15:39:48 2009 for Qpid C++ Client API by doxygen 1.4.7