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

Utility to assist with creating subscriptions. More...

#include <SubscriptionManager.h>

Inheritance diagram for qpid::client::SubscriptionManager:

Inheritance graph
[legend]
Collaboration diagram for qpid::client::SubscriptionManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SubscriptionManager (Session &session)
Completion subscribe (MessageListener &listener, const std::string &queue, const std::string &tag=std::string())
 Subscribe a MessagesListener to receive messages from queue.
Completion subscribe (LocalQueue &localQueue, const std::string &queue, const std::string &tag=std::string())
 Subscribe a LocalQueue to receive messages from queue.
void cancel (const std::string tag)
 Cancel a subscription.
void run ()
 Deliver messages until stop() is called.
void setAutoStop (bool set=true)
 If set true, run() will stop when all subscriptions are cancelled.
void stop ()
 Cause run() to return.
void setFlowControl (const std::string &tag, uint32_t messages, uint32_t bytes, bool window=true)
 Set the flow control for destination tag.
void setFlowControl (uint32_t messages, uint32_t bytes, bool window=true)
 Set the initial flow control settings to be applied to each new subscribtion.
void setAcceptMode (bool required)
 Set the accept-mode for new subscriptions.
void setAcquireMode (bool acquire)
 Set the acquire-mode for new subscriptions.
void setAckPolicy (const AckPolicy &autoAck)
 Set the acknowledgement policy for new subscriptions.
AckPolicygetAckPolicy ()

Static Public Attributes

static const uint32_t UNLIMITED = 0xFFFFFFFF


Detailed Description

Utility to assist with creating subscriptions.

Member Function Documentation

Completion qpid::client::SubscriptionManager::subscribe ( MessageListener listener,
const std::string &  queue,
const std::string &  tag = std::string() 
)

Subscribe a MessagesListener to receive messages from queue.

Parameters:
listener Listener object to receive messages.
queue Name of the queue to subscribe to.
tag Unique destination tag for the listener. If not specified, the queue name is used.

Completion qpid::client::SubscriptionManager::subscribe ( LocalQueue localQueue,
const std::string &  queue,
const std::string &  tag = std::string() 
)

Subscribe a LocalQueue to receive messages from queue.

Parameters:
queue Name of the queue to subscribe to.
tag Unique destination tag for the listener. If not specified, the queue name is used.

void qpid::client::SubscriptionManager::cancel ( const std::string  tag  ) 

Cancel a subscription.

void qpid::client::SubscriptionManager::run (  )  [virtual]

Deliver messages until stop() is called.

Implements qpid::sys::Runnable.

void qpid::client::SubscriptionManager::setAutoStop ( bool  set = true  ) 

If set true, run() will stop when all subscriptions are cancelled.

If false, run will only stop when stop() is called. True by default.

void qpid::client::SubscriptionManager::setFlowControl ( const std::string &  tag,
uint32_t  messages,
uint32_t  bytes,
bool  window = true 
)

Set the flow control for destination tag.

Parameters:
tag,: name of the destination.
messages,: message credit.
bytes,: byte credit.
window,: if true use window-based flow control.

void qpid::client::SubscriptionManager::setFlowControl ( uint32_t  messages,
uint32_t  bytes,
bool  window = true 
)

Set the initial flow control settings to be applied to each new subscribtion.

Parameters:
messages,: message credit.
bytes,: byte credit.
window,: if true use window-based flow control.

void qpid::client::SubscriptionManager::setAcceptMode ( bool  required  ) 

Set the accept-mode for new subscriptions.

Defaults to true.

Parameters:
required,: if true messages must be confirmed by calling Message::acknowledge() or automatically, see setAckPolicy()

void qpid::client::SubscriptionManager::setAcquireMode ( bool  acquire  ) 

Set the acquire-mode for new subscriptions.

Defaults to false.

Parameters:
acquire,: if false messages pre-acquired, if true messages are dequed on acknowledgement or on transfer depending on acceptMode.

void qpid::client::SubscriptionManager::setAckPolicy ( const AckPolicy autoAck  ) 

Set the acknowledgement policy for new subscriptions.

Default is to acknowledge every message automatically.


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

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