Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
A handle to an active subscription. More...
#include <qpid/client/Subscription.h>
Public Member Functions | |
Subscription (SubscriptionImpl *=0) | |
Subscription (const Subscription &) | |
~Subscription () | |
Subscription & | operator= (const Subscription &) |
std::string | getName () const |
The name of the subscription, used as the "destination" for messages from the broker. More... | |
std::string | getQueue () const |
Name of the queue this subscription subscribes to. More... | |
const SubscriptionSettings & | getSettings () const |
Get the flow control and acknowledgement settings for this subscription. More... | |
void | setFlowControl (const FlowControl &) |
Set the flow control parameters. More... | |
void | setAutoAck (unsigned int n) |
Automatically acknowledge (acquire and accept) batches of n messages. More... | |
SequenceSet | getUnacquired () const |
Get the set of ID's for messages received by this subscription but not yet acquired. More... | |
SequenceSet | getUnaccepted () const |
Get the set of ID's for messages received by this subscription but not yet accepted. More... | |
void | acquire (const SequenceSet &messageIds) |
Acquire messageIds and remove them from the unacquired set. More... | |
void | accept (const SequenceSet &messageIds) |
Accept messageIds and remove them from the unaccepted set. More... | |
void | release (const SequenceSet &messageIds) |
Release messageIds and remove them from the unaccepted set. More... | |
QPID_CLIENT_INLINE_EXTERN void | acquire (const Message &m) |
QPID_CLIENT_INLINE_EXTERN void | accept (const Message &m) |
QPID_CLIENT_INLINE_EXTERN void | release (const Message &m) |
Session | getSession () const |
Get the session associated with this subscription. More... | |
SubscriptionManager | getSubscriptionManager () |
Get the subscription manager associated with this subscription. More... | |
void | cancel () |
Cancel the subscription. More... | |
void | grantMessageCredit (uint32_t) |
Grant the specified amount of message credit. More... | |
void | grantByteCredit (uint32_t) |
Grant the specified amount of byte credit. More... | |
QPID_CLIENT_INLINE_EXTERN bool | isValid () const |
QPID_CLIENT_INLINE_EXTERN bool | isNull () const |
QPID_CLIENT_INLINE_EXTERN | operator bool () const |
Conversion to bool supports idiom if (handle) { handle->... More... | |
QPID_CLIENT_INLINE_EXTERN bool | operator! () const |
Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }. More... | |
void | swap (Handle< SubscriptionImpl > &h) |
Protected Types | |
typedef SubscriptionImpl | Impl |
Protected Attributes | |
Impl * | impl |
A handle to an active subscription.
Provides methods to query the subscription status and control acknowledgement (acquire and accept) of messages.
Definition at line 42 of file Subscription.h.
|
protectedinherited |
qpid::client::Subscription::Subscription | ( | SubscriptionImpl * | = 0 | ) |
qpid::client::Subscription::Subscription | ( | const Subscription & | ) |
qpid::client::Subscription::~Subscription | ( | ) |
void qpid::client::Subscription::accept | ( | const SequenceSet & | messageIds | ) |
Accept messageIds and remove them from the unaccepted set.
|
inline |
Definition at line 97 of file Subscription.h.
References accept(), and qpid::client::Message::getId().
Referenced by accept().
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.
|
inline |
Definition at line 94 of file Subscription.h.
References acquire(), and qpid::client::Message::getId().
Referenced by acquire().
void qpid::client::Subscription::cancel | ( | ) |
Cancel the subscription.
std::string qpid::client::Subscription::getName | ( | ) | const |
The name of the subscription, 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 | ( | ) |
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.
|
inlineinherited |
Definition at line 46 of file Handle.h.
References qpid::client::Handle< T >::impl.
|
inlineinherited |
Definition at line 43 of file Handle.h.
References qpid::client::Handle< T >::impl.
|
inlineinherited |
Conversion to bool supports idiom if (handle) { handle->...
}
Definition at line 49 of file Handle.h.
References qpid::client::Handle< T >::impl.
|
inlineinherited |
Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
Definition at line 52 of file Handle.h.
References qpid::client::Handle< T >::impl.
Subscription& qpid::client::Subscription::operator= | ( | const Subscription & | ) |
void qpid::client::Subscription::release | ( | const SequenceSet & | messageIds | ) |
Release messageIds and remove them from the unaccepted set.
|
inline |
Definition at line 100 of file Subscription.h.
References qpid::client::Message::getId(), and release().
Referenced by release().
void qpid::client::Subscription::setAutoAck | ( | unsigned int | n | ) |
void qpid::client::Subscription::setFlowControl | ( | const FlowControl & | ) |
Set the flow control parameters.
|
inlineinherited |
Definition at line 54 of file Handle.h.
References qmf::Handle< T >::impl, and qpid::client::Handle< T >::impl.
|
protectedinherited |