From f83677056891e436bf5ba99e79240df2a44528cd Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Fri, 21 Oct 2011 14:42:12 +0000 Subject: Merged out from trunk git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-2519@1187375 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/include/qpid/messaging/Session.h | 51 +++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) (limited to 'cpp/include/qpid/messaging/Session.h') diff --git a/cpp/include/qpid/messaging/Session.h b/cpp/include/qpid/messaging/Session.h index 6c023629e0..e8d6efb35d 100644 --- a/cpp/include/qpid/messaging/Session.h +++ b/cpp/include/qpid/messaging/Session.h @@ -46,7 +46,7 @@ class SessionImpl; * A session represents a distinct 'conversation' which can involve * sending and receiving messages to and from different addresses. */ -class Session : public qpid::messaging::Handle +class QPID_MESSAGING_CLASS_EXTERN Session : public qpid::messaging::Handle { public: QPID_MESSAGING_EXTERN Session(SessionImpl* impl = 0); @@ -62,6 +62,12 @@ class Session : public qpid::messaging::Handle */ QPID_MESSAGING_EXTERN void close(); + /** + * Commits the sessions transaction. + * + * @exception TransactionAborted if the original session is lost + * forcing an automatic rollback. + */ QPID_MESSAGING_EXTERN void commit(); QPID_MESSAGING_EXTERN void rollback(); @@ -77,6 +83,10 @@ class Session : public qpid::messaging::Handle * Acknowledges the specified message. */ QPID_MESSAGING_EXTERN void acknowledge(Message&, bool sync=false); + /** + * Acknowledges all message up to the specified message. + */ + QPID_MESSAGING_EXTERN void acknowledgeUpTo(Message&, bool sync=false); /** * Rejects the specified message. The broker does not redeliver a * message that has been rejected. Once a message has been @@ -135,25 +145,51 @@ class Session : public qpid::messaging::Handle /** * Create a new sender through which messages can be sent to the * specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address */ QPID_MESSAGING_EXTERN Sender createSender(const Address& address); + /** + * Create a new sender through which messages can be sent to the + * specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address + * + * @exception MalformedAddress if the syntax of address is not + * valid + */ QPID_MESSAGING_EXTERN Sender createSender(const std::string& address); /** * Create a new receiver through which messages can be received * from the specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address */ QPID_MESSAGING_EXTERN Receiver createReceiver(const Address& address); + /** + * Create a new receiver through which messages can be received + * from the specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address + * + * @exception MalformedAddress if the syntax of address is not + * valid + */ QPID_MESSAGING_EXTERN Receiver createReceiver(const std::string& address); /** * Returns the sender with the specified name. - *@exception KeyError if there is none for that name. + * @exception KeyError if there is none for that name. */ QPID_MESSAGING_EXTERN Sender getSender(const std::string& name) const; /** * Returns the receiver with the specified name. - *@exception KeyError if there is none for that name. + * @exception KeyError if there is none for that name. */ QPID_MESSAGING_EXTERN Receiver getReceiver(const std::string& name) const; /** @@ -162,7 +198,16 @@ class Session : public qpid::messaging::Handle */ QPID_MESSAGING_EXTERN Connection getConnection() const; + /** + * @returns true if the session has been rendered invalid by some + * exception, false if it is valid for use. + */ QPID_MESSAGING_EXTERN bool hasError(); + /** + * If the session has been rendered invalid by some exception, + * this method will result in that exception being thrown on + * calling this method. + */ QPID_MESSAGING_EXTERN void checkError(); #ifndef SWIG -- cgit v1.2.1