diff options
Diffstat (limited to 'qpid/cpp/include/qpid/messaging')
-rw-r--r-- | qpid/cpp/include/qpid/messaging/Receiver.h | 33 | ||||
-rw-r--r-- | qpid/cpp/include/qpid/messaging/Sender.h | 19 | ||||
-rw-r--r-- | qpid/cpp/include/qpid/messaging/Session.h | 14 |
3 files changed, 57 insertions, 9 deletions
diff --git a/qpid/cpp/include/qpid/messaging/Receiver.h b/qpid/cpp/include/qpid/messaging/Receiver.h index e51e1093d1..a4fdd7a34b 100644 --- a/qpid/cpp/include/qpid/messaging/Receiver.h +++ b/qpid/cpp/include/qpid/messaging/Receiver.h @@ -40,7 +40,7 @@ class MessageListener; class ReceiverImpl; /** - * A pull style interface for message retrieval. + * Interface through which messages are received. */ class Receiver : public qpid::client::Handle<ReceiverImpl> { @@ -75,7 +75,7 @@ class Receiver : public qpid::client::Handle<ReceiverImpl> QPID_CLIENT_EXTERN bool fetch(Message& message, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE); /** * Retrieves a message for this receivers subscription or waits - * for upto the specified timeout for one to become + * for up to the specified timeout for one to become * available. Unlike get() this method will check with the server * that there is no message for the subscription this receiver is * serving before throwing an exception. @@ -87,8 +87,8 @@ class Receiver : public qpid::client::Handle<ReceiverImpl> */ QPID_CLIENT_EXTERN void start(); /** - * Stops the message flow for this receiver (without actually - * cancelling the subscription). + * Stops the message flow for this receiver (but does not cancel + * the subscription). */ QPID_CLIENT_EXTERN void stop(); /** @@ -97,14 +97,35 @@ class Receiver : public qpid::client::Handle<ReceiverImpl> * requested by a client via fetch() (or pushed to a listener). */ QPID_CLIENT_EXTERN void setCapacity(uint32_t); + /** + * Returns the capacity of the receiver. The capacity determines + * how many incoming messages can be held in the receiver before + * being requested by a client via fetch() (or pushed to a + * listener). + */ + QPID_CLIENT_EXTERN uint32_t getCapacity(); + /** + * Returns the number of messages received and waiting to be + * fetched. + */ + QPID_CLIENT_EXTERN uint32_t available(); + /** + * Returns a count of the number of messages received on this + * receiver that have been acknowledged, but for which that + * acknowledgement has not yet been confirmed as processed by the + * server. + */ + QPID_CLIENT_EXTERN uint32_t pendingAck(); /** - * Cancels this receiver + * Cancels this receiver. */ QPID_CLIENT_EXTERN void cancel(); /** - * Set a message listener for receiving messages asynchronously. + * Set a message listener for this receiver. + * + * @see Session::dispatch() */ QPID_CLIENT_EXTERN void setListener(MessageListener* listener); private: diff --git a/qpid/cpp/include/qpid/messaging/Sender.h b/qpid/cpp/include/qpid/messaging/Sender.h index 45ec659ecf..9b83a04d60 100644 --- a/qpid/cpp/include/qpid/messaging/Sender.h +++ b/qpid/cpp/include/qpid/messaging/Sender.h @@ -23,6 +23,7 @@ */ #include "qpid/client/ClientImportExport.h" #include "qpid/client/Handle.h" +#include "qpid/sys/IntegerTypes.h" namespace qpid { namespace client { @@ -49,6 +50,24 @@ class Sender : public qpid::client::Handle<SenderImpl> QPID_CLIENT_EXTERN void send(const Message& message); QPID_CLIENT_EXTERN void cancel(); + + /** + * Sets the capacity for the sender. The capacity determines how + * many outgoing messages can be held pending confirmation of + * receipt by the broker. + */ + QPID_CLIENT_EXTERN void setCapacity(uint32_t); + /** + * Returns the capacity of the sender. + * @see setCapacity + */ + QPID_CLIENT_EXTERN uint32_t getCapacity(); + /** + * Returns the number of sent messages pending confirmation of + * receipt by the broker. (These are the 'in-doubt' messages). + */ + QPID_CLIENT_EXTERN uint32_t pending(); + private: friend class qpid::client::PrivateImplRef<Sender>; }; diff --git a/qpid/cpp/include/qpid/messaging/Session.h b/qpid/cpp/include/qpid/messaging/Session.h index 1d88882db6..979e27adae 100644 --- a/qpid/cpp/include/qpid/messaging/Session.h +++ b/qpid/cpp/include/qpid/messaging/Session.h @@ -75,6 +75,17 @@ class Session : public qpid::client::Handle<SessionImpl> QPID_CLIENT_EXTERN void sync(); QPID_CLIENT_EXTERN void flush(); + /** + * Returns the number of messages received and waiting to be + * fetched. + */ + QPID_CLIENT_EXTERN uint32_t available(); + /** + * 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. + */ + QPID_CLIENT_EXTERN uint32_t pendingAck(); QPID_CLIENT_EXTERN bool fetch(Message& message, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE); QPID_CLIENT_EXTERN Message fetch(qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE); QPID_CLIENT_EXTERN bool dispatch(qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE); @@ -88,9 +99,6 @@ class Session : public qpid::client::Handle<SessionImpl> QPID_CLIENT_EXTERN Receiver createReceiver(const std::string& address, const Filter& filter, const VariantMap& options = VariantMap()); QPID_CLIENT_EXTERN Address createTempQueue(const std::string& baseName = std::string()); - - QPID_CLIENT_EXTERN void* getLastConfirmedSent(); - QPID_CLIENT_EXTERN void* getLastConfirmedAcknowledged(); private: friend class qpid::client::PrivateImplRef<Session>; }; |