summaryrefslogtreecommitdiff
path: root/cpp/include/qpid/messaging
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2011-10-21 14:42:12 +0000
committerStephen D. Huston <shuston@apache.org>2011-10-21 14:42:12 +0000
commitf83677056891e436bf5ba99e79240df2a44528cd (patch)
tree625bfd644b948e89105630759cf6decb0435354d /cpp/include/qpid/messaging
parentebfd9ff053b04ab379acfc0fefedee5a31b6d8a5 (diff)
downloadqpid-python-QPID-2519.tar.gz
Merged out from trunkQPID-2519
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-2519@1187375 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include/qpid/messaging')
-rw-r--r--cpp/include/qpid/messaging/Address.h2
-rw-r--r--cpp/include/qpid/messaging/Connection.h30
-rw-r--r--cpp/include/qpid/messaging/Duration.h8
-rw-r--r--cpp/include/qpid/messaging/FailoverUpdates.h2
-rw-r--r--cpp/include/qpid/messaging/Handle.h10
-rw-r--r--cpp/include/qpid/messaging/ImportExport.h14
-rw-r--r--cpp/include/qpid/messaging/Message.h101
-rw-r--r--cpp/include/qpid/messaging/Receiver.h2
-rw-r--r--cpp/include/qpid/messaging/Sender.h2
-rw-r--r--cpp/include/qpid/messaging/Session.h51
-rw-r--r--cpp/include/qpid/messaging/exceptions.h98
11 files changed, 244 insertions, 76 deletions
diff --git a/cpp/include/qpid/messaging/Address.h b/cpp/include/qpid/messaging/Address.h
index bebbfc72f6..63dce0c49d 100644
--- a/cpp/include/qpid/messaging/Address.h
+++ b/cpp/include/qpid/messaging/Address.h
@@ -119,7 +119,7 @@ class AddressImpl;
*
* An address has value semantics.
*/
-class Address
+class QPID_MESSAGING_CLASS_EXTERN Address
{
public:
QPID_MESSAGING_EXTERN Address();
diff --git a/cpp/include/qpid/messaging/Connection.h b/cpp/include/qpid/messaging/Connection.h
index 1ad7a7242f..165573e2ef 100644
--- a/cpp/include/qpid/messaging/Connection.h
+++ b/cpp/include/qpid/messaging/Connection.h
@@ -42,7 +42,7 @@ class Session;
* A connection represents a network connection to a remote endpoint.
*/
-class Connection : public qpid::messaging::Handle<ConnectionImpl>
+class QPID_MESSAGING_CLASS_EXTERN Connection : public qpid::messaging::Handle<ConnectionImpl>
{
public:
QPID_MESSAGING_EXTERN Connection(ConnectionImpl* impl);
@@ -54,27 +54,27 @@ class Connection : public qpid::messaging::Handle<ConnectionImpl>
* username
* password
* heartbeat
- * tcp-nodelay
- * sasl-mechanism
- * sasl-service
- * sasl-min-ssf
- * sasl-max-ssf
+ * tcp_nodelay
+ * sasl_mechanisms
+ * sasl_service
+ * sasl_min_ssf
+ * sasl_max_ssf
* transport
*
* Reconnect behaviour can be controlled through the following options:
*
* reconnect: true/false (enables/disables reconnect entirely)
- * reconnect-timeout: number of seconds (give up and report failure after specified time)
- * reconnect-limit: n (give up and report failure after specified number of attempts)
- * reconnect-interval-min: number of seconds (initial delay between failed reconnection attempts)
- * reconnect-interval-max: number of seconds (maximum delay between failed reconnection attempts)
- * reconnect-interval: shorthand for setting the same reconnect_interval_min/max
- * reconnect-urls: list of alternate urls to try when connecting
+ * reconnect_timeout: number of seconds (give up and report failure after specified time)
+ * reconnect_limit: n (give up and report failure after specified number of attempts)
+ * reconnect_interval_min: number of seconds (initial delay between failed reconnection attempts)
+ * reconnect_interval_max: number of seconds (maximum delay between failed reconnection attempts)
+ * reconnect_interval: shorthand for setting the same reconnect_interval_min/max
+ * reconnect_urls: list of alternate urls to try when connecting
*
- * The reconnect-interval is the time that the client waits
+ * The reconnect_interval is the time that the client waits
* for after a failed attempt to reconnect before retrying. It
- * starts at the value of the min-retry-interval and is
- * doubled every failure until the value of max-retry-interval
+ * starts at the value of the min_retry_interval and is
+ * doubled every failure until the value of max_retry_interval
* is reached.
*/
QPID_MESSAGING_EXTERN Connection(const std::string& url, const qpid::types::Variant::Map& options = qpid::types::Variant::Map());
diff --git a/cpp/include/qpid/messaging/Duration.h b/cpp/include/qpid/messaging/Duration.h
index abcf169090..6b8f05c7c6 100644
--- a/cpp/include/qpid/messaging/Duration.h
+++ b/cpp/include/qpid/messaging/Duration.h
@@ -32,7 +32,7 @@ namespace messaging {
/** \ingroup messaging
* A duration is a time in milliseconds.
*/
-class Duration
+class QPID_MESSAGING_CLASS_EXTERN Duration
{
public:
QPID_MESSAGING_EXTERN explicit Duration(uint64_t milliseconds);
@@ -46,9 +46,11 @@ class Duration
};
QPID_MESSAGING_EXTERN Duration operator*(const Duration& duration,
- uint64_t multiplier);
+ uint64_t multiplier);
QPID_MESSAGING_EXTERN Duration operator*(uint64_t multiplier,
- const Duration& duration);
+ const Duration& duration);
+QPID_MESSAGING_EXTERN bool operator==(const Duration& a, const Duration& b);
+QPID_MESSAGING_EXTERN bool operator!=(const Duration& a, const Duration& b);
}} // namespace qpid::messaging
diff --git a/cpp/include/qpid/messaging/FailoverUpdates.h b/cpp/include/qpid/messaging/FailoverUpdates.h
index 14a1a31b63..6d7314620a 100644
--- a/cpp/include/qpid/messaging/FailoverUpdates.h
+++ b/cpp/include/qpid/messaging/FailoverUpdates.h
@@ -32,7 +32,7 @@ struct FailoverUpdatesImpl;
* A utility to listen for updates on cluster membership and update
* the list of known urls for a connection accordingly.
*/
-class FailoverUpdates
+class QPID_MESSAGING_CLASS_EXTERN FailoverUpdates
{
public:
QPID_MESSAGING_EXTERN FailoverUpdates(Connection& connection);
diff --git a/cpp/include/qpid/messaging/Handle.h b/cpp/include/qpid/messaging/Handle.h
index 1e634ef888..97a8f00b54 100644
--- a/cpp/include/qpid/messaging/Handle.h
+++ b/cpp/include/qpid/messaging/Handle.h
@@ -40,22 +40,22 @@ template <class T> class Handle {
public:
/**@return true if handle is valid, i.e. not null. */
- QPID_MESSAGING_EXTERN bool isValid() const { return impl; }
+ QPID_MESSAGING_INLINE_EXTERN bool isValid() const { return impl; }
/**@return true if handle is null. It is an error to call any function on a null handle. */
- QPID_MESSAGING_EXTERN bool isNull() const { return !impl; }
+ QPID_MESSAGING_INLINE_EXTERN bool isNull() const { return !impl; }
/** Conversion to bool supports idiom if (handle) { handle->... } */
- QPID_MESSAGING_EXTERN operator bool() const { return impl; }
+ QPID_MESSAGING_INLINE_EXTERN operator bool() const { return impl; }
/** Operator ! supports idiom if (!handle) { do_if_handle_is_null(); } */
- QPID_MESSAGING_EXTERN bool operator !() const { return !impl; }
+ QPID_MESSAGING_INLINE_EXTERN bool operator !() const { return !impl; }
void swap(Handle<T>& h) { T* t = h.impl; h.impl = impl; impl = t; }
protected:
typedef T Impl;
- QPID_MESSAGING_EXTERN Handle() :impl() {}
+ QPID_MESSAGING_INLINE_EXTERN Handle() :impl() {}
// Not implemented,subclasses must implement.
QPID_MESSAGING_EXTERN Handle(const Handle&);
diff --git a/cpp/include/qpid/messaging/ImportExport.h b/cpp/include/qpid/messaging/ImportExport.h
index 52f3eb8568..ab5f21f618 100644
--- a/cpp/include/qpid/messaging/ImportExport.h
+++ b/cpp/include/qpid/messaging/ImportExport.h
@@ -20,14 +20,16 @@
* under the License.
*/
-#if defined(WIN32) && !defined(QPID_DECLARE_STATIC)
+#include "qpid/ImportExport.h"
+
#if defined(CLIENT_EXPORT) || defined (qpidmessaging_EXPORTS)
-#define QPID_MESSAGING_EXTERN __declspec(dllexport)
-#else
-#define QPID_MESSAGING_EXTERN __declspec(dllimport)
-#endif
+# define QPID_MESSAGING_EXTERN QPID_EXPORT
+# define QPID_MESSAGING_CLASS_EXTERN QPID_CLASS_EXPORT
+# define QPID_MESSAGING_INLINE_EXTERN QPID_INLINE_EXPORT
#else
-#define QPID_MESSAGING_EXTERN
+# define QPID_MESSAGING_EXTERN QPID_IMPORT
+# define QPID_MESSAGING_CLASS_EXTERN QPID_CLASS_IMPORT
+# define QPID_MESSAGING_INLINE_EXTERN QPID_INLINE_IMPORT
#endif
#endif /*!QPID_MESSAGING_IMPORTEXPORT_H*/
diff --git a/cpp/include/qpid/messaging/Message.h b/cpp/include/qpid/messaging/Message.h
index d48af35cc0..e89a6ce02f 100644
--- a/cpp/include/qpid/messaging/Message.h
+++ b/cpp/include/qpid/messaging/Message.h
@@ -39,7 +39,7 @@ struct MessageImpl;
/** \ingroup messaging
* Representation of a message.
*/
-class Message
+class QPID_MESSAGING_CLASS_EXTERN Message
{
public:
QPID_MESSAGING_EXTERN Message(const std::string& bytes = std::string());
@@ -55,23 +55,58 @@ class Message
QPID_MESSAGING_EXTERN void setSubject(const std::string&);
QPID_MESSAGING_EXTERN const std::string& getSubject() const;
+ /**
+ * Set the content type (i.e. the MIME type) for the message. This
+ * should be set by the sending application and indicates to
+ * recipients of message how to interpret or decode the content.
+ */
QPID_MESSAGING_EXTERN void setContentType(const std::string&);
+ /**
+ * Returns the content type (i.e. the MIME type) for the
+ * message. This can be used to determine how to decode the
+ * message content.
+ */
QPID_MESSAGING_EXTERN const std::string& getContentType() const;
+ /**
+ * Set an application defined identifier for the message. At
+ * present this must be a stringfied UUID (support for less
+ * restrictive IDs is anticipated however).
+ */
QPID_MESSAGING_EXTERN void setMessageId(const std::string&);
QPID_MESSAGING_EXTERN const std::string& getMessageId() const;
+ /**
+ * Sets the user id of the message. This should in general be the
+ * user-id as which the sending connection authenticated itself as
+ * the messaging infrastructure will verify this. See
+ * Connection::getAuthenticatedUsername()
+ */
QPID_MESSAGING_EXTERN void setUserId(const std::string&);
QPID_MESSAGING_EXTERN const std::string& getUserId() const;
+ /**
+ * Can be used to set application specific correlation identifiers
+ * as part of a protocol for message exchange patterns. E.g. a
+ * request-reponse pattern might require the correlation-id of the
+ * request and response to match, or might use the message-id of
+ * the request as the correlation-id on the response etc.
+ */
QPID_MESSAGING_EXTERN void setCorrelationId(const std::string&);
QPID_MESSAGING_EXTERN const std::string& getCorrelationId() const;
+ /**
+ * Sets a priority level on the message. This may be used by the
+ * messaging infrastructure to prioritise delivery of higher
+ * priority messages.
+ */
QPID_MESSAGING_EXTERN void setPriority(uint8_t);
QPID_MESSAGING_EXTERN uint8_t getPriority() const;
/**
- * Set the time to live for this message in milliseconds.
+ * Set the time to live for this message in milliseconds. This can
+ * be used by the messaging infrastructure to discard messages
+ * that are no longer of relevance.
*/
QPID_MESSAGING_EXTERN void setTtl(Duration ttl);
/**
@@ -79,24 +114,62 @@ class Message
*/
QPID_MESSAGING_EXTERN Duration getTtl() const;
+ /**
+ * Mark the message as durable. This is a hint to the messaging
+ * infrastructure that the message should be persisted or
+ * otherwise stored such that failoures or shutdown do not cause
+ * it to be lost.
+ */
QPID_MESSAGING_EXTERN void setDurable(bool durable);
QPID_MESSAGING_EXTERN bool getDurable() const;
+ /**
+ * The redelivered flag if set implies that the message *may* have
+ * been previously delivered and thus is a hint to the application
+ * or messaging infrastructure that if de-duplication is required
+ * this message should be examined to determine if it is a
+ * duplicate.
+ */
QPID_MESSAGING_EXTERN bool getRedelivered() const;
+ /**
+ * Can be used to provide a hint to the application or messaging
+ * infrastructure that if de-duplication is required this message
+ * should be examined to determine if it is a duplicate.
+ */
QPID_MESSAGING_EXTERN void setRedelivered(bool);
+ /**
+ * In addition to a payload (i.e. the content), messages can
+ * include annotations describing aspectf of the message. In
+ * addition to the standard annotations such as TTL and content
+ * type, application- or context- specific properties can also be
+ * defined. Each message has a map of name values for such custom
+ * properties. The value is specified as a Variant.
+ */
QPID_MESSAGING_EXTERN const qpid::types::Variant::Map& getProperties() const;
QPID_MESSAGING_EXTERN qpid::types::Variant::Map& getProperties();
+ /**
+ * Set the content to the data held in the string parameter. Note:
+ * this is treated as raw bytes and need not be text. Consider
+ * setting the content-type to indicate how the data should be
+ * interpreted by recipients.
+ */
QPID_MESSAGING_EXTERN void setContent(const std::string&);
/**
- * Note that chars are copied.
+ * Copy count bytes from the region pointed to by chars as the
+ * message content.
*/
QPID_MESSAGING_EXTERN void setContent(const char* chars, size_t count);
/** Get the content as a std::string */
QPID_MESSAGING_EXTERN std::string getContent() const;
- /** Get a const pointer to the start of the content data. */
+ /**
+ * Get a const pointer to the start of the content data. The
+ * memory pointed to is owned by the message. The getContentSize()
+ * method indicates how much data there is (i.e. the extent of the
+ * memory region pointed to by the return value of this method).
+ */
QPID_MESSAGING_EXTERN const char* getContentPtr() const;
/** Get the size of content in bytes. */
QPID_MESSAGING_EXTERN size_t getContentSize() const;
@@ -107,9 +180,9 @@ class Message
friend struct MessageImplAccess;
};
-struct EncodingException : qpid::types::Exception
+struct QPID_MESSAGING_CLASS_EXTERN EncodingException : qpid::types::Exception
{
- EncodingException(const std::string& msg);
+ QPID_MESSAGING_EXTERN EncodingException(const std::string& msg);
};
/**
@@ -122,8 +195,8 @@ struct EncodingException : qpid::types::Exception
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void decode(const Message& message,
- qpid::types::Variant::Map& map,
- const std::string& encoding = std::string());
+ qpid::types::Variant::Map& map,
+ const std::string& encoding = std::string());
/**
* Decodes message content into a Variant::List.
*
@@ -134,8 +207,8 @@ QPID_MESSAGING_EXTERN void decode(const Message& message,
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void decode(const Message& message,
- qpid::types::Variant::List& list,
- const std::string& encoding = std::string());
+ qpid::types::Variant::List& list,
+ const std::string& encoding = std::string());
/**
* Encodes a Variant::Map into a message.
*
@@ -146,8 +219,8 @@ QPID_MESSAGING_EXTERN void decode(const Message& message,
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::Map& map,
- Message& message,
- const std::string& encoding = std::string());
+ Message& message,
+ const std::string& encoding = std::string());
/**
* Encodes a Variant::List into a message.
*
@@ -158,8 +231,8 @@ QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::Map& map,
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::List& list,
- Message& message,
- const std::string& encoding = std::string());
+ Message& message,
+ const std::string& encoding = std::string());
}} // namespace qpid::messaging
diff --git a/cpp/include/qpid/messaging/Receiver.h b/cpp/include/qpid/messaging/Receiver.h
index 6f3ae961db..13317dfcbd 100644
--- a/cpp/include/qpid/messaging/Receiver.h
+++ b/cpp/include/qpid/messaging/Receiver.h
@@ -41,7 +41,7 @@ class Session;
/** \ingroup messaging
* Interface through which messages are received.
*/
-class Receiver : public qpid::messaging::Handle<ReceiverImpl>
+class QPID_MESSAGING_CLASS_EXTERN Receiver : public qpid::messaging::Handle<ReceiverImpl>
{
public:
QPID_MESSAGING_EXTERN Receiver(ReceiverImpl* impl = 0);
diff --git a/cpp/include/qpid/messaging/Sender.h b/cpp/include/qpid/messaging/Sender.h
index 85658f37cc..8e1c5846e9 100644
--- a/cpp/include/qpid/messaging/Sender.h
+++ b/cpp/include/qpid/messaging/Sender.h
@@ -40,7 +40,7 @@ class Session;
/** \ingroup messaging
* Interface through which messages are sent.
*/
-class Sender : public qpid::messaging::Handle<SenderImpl>
+class QPID_MESSAGING_CLASS_EXTERN Sender : public qpid::messaging::Handle<SenderImpl>
{
public:
QPID_MESSAGING_EXTERN Sender(SenderImpl* impl = 0);
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<SessionImpl>
+class QPID_MESSAGING_CLASS_EXTERN Session : public qpid::messaging::Handle<SessionImpl>
{
public:
QPID_MESSAGING_EXTERN Session(SessionImpl* impl = 0);
@@ -62,6 +62,12 @@ class Session : public qpid::messaging::Handle<SessionImpl>
*/
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();
@@ -78,6 +84,10 @@ class Session : public qpid::messaging::Handle<SessionImpl>
*/
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
* acknowledged, it can no longer be rejected.
@@ -135,25 +145,51 @@ class Session : public qpid::messaging::Handle<SessionImpl>
/**
* 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<SessionImpl>
*/
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
diff --git a/cpp/include/qpid/messaging/exceptions.h b/cpp/include/qpid/messaging/exceptions.h
index 0ff608b343..31e2488d91 100644
--- a/cpp/include/qpid/messaging/exceptions.h
+++ b/cpp/include/qpid/messaging/exceptions.h
@@ -10,9 +10,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,34 +29,47 @@
namespace qpid {
namespace messaging {
-/** \ingroup messaging
+/** \ingroup messaging
*/
-struct MessagingException : public qpid::types::Exception
+/**
+ * This is the base class for all messaging related exceptions thrown
+ * by this API.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN MessagingException : public qpid::types::Exception
{
QPID_MESSAGING_EXTERN MessagingException(const std::string& msg);
QPID_MESSAGING_EXTERN virtual ~MessagingException() throw();
-
+
qpid::types::Variant::Map detail;
//TODO: override what() to include detail if present
};
-struct InvalidOptionString : public MessagingException
+/**
+ * Thrown when the syntax of the option string used to configure a
+ * connection in not valid
+ */
+struct QPID_MESSAGING_CLASS_EXTERN InvalidOptionString : public MessagingException
{
QPID_MESSAGING_EXTERN InvalidOptionString(const std::string& msg);
};
-struct KeyError : public MessagingException
+/**
+ * Thrown to indicate a failed lookup of some local object. For
+ * example when attempting to retrieve a session, sender or receiver
+ * by name.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN KeyError : public MessagingException
{
QPID_MESSAGING_EXTERN KeyError(const std::string&);
};
-struct LinkError : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN LinkError : public MessagingException
{
QPID_MESSAGING_EXTERN LinkError(const std::string&);
};
-struct AddressError : public LinkError
+struct QPID_MESSAGING_CLASS_EXTERN AddressError : public LinkError
{
QPID_MESSAGING_EXTERN AddressError(const std::string&);
};
@@ -65,85 +78,118 @@ struct AddressError : public LinkError
* Thrown when a syntactically correct address cannot be resolved or
* used.
*/
-struct ResolutionError : public AddressError
+struct QPID_MESSAGING_CLASS_EXTERN ResolutionError : public AddressError
{
QPID_MESSAGING_EXTERN ResolutionError(const std::string& msg);
};
-struct AssertionFailed : public ResolutionError
+/**
+ * Thrown when creating a sender or receiver for an address for which
+ * some asserted property of the node is not matched.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN AssertionFailed : public ResolutionError
{
QPID_MESSAGING_EXTERN AssertionFailed(const std::string& msg);
};
-struct NotFound : public ResolutionError
+/**
+ * Thrown on attempts to create a sender or receiver to a non-existent
+ * node.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN NotFound : public ResolutionError
{
QPID_MESSAGING_EXTERN NotFound(const std::string& msg);
};
/**
- * Thrown when an address string with inalid sytanx is used.
+ * Thrown when an address string with invalid syntax is used.
*/
-struct MalformedAddress : public AddressError
+struct QPID_MESSAGING_CLASS_EXTERN MalformedAddress : public AddressError
{
QPID_MESSAGING_EXTERN MalformedAddress(const std::string& msg);
};
-struct ReceiverError : public LinkError
+struct QPID_MESSAGING_CLASS_EXTERN ReceiverError : public LinkError
{
QPID_MESSAGING_EXTERN ReceiverError(const std::string&);
};
-struct FetchError : public ReceiverError
+struct QPID_MESSAGING_CLASS_EXTERN FetchError : public ReceiverError
{
QPID_MESSAGING_EXTERN FetchError(const std::string&);
};
-struct NoMessageAvailable : public FetchError
+/**
+ * Thrown by Receiver::fetch(), Receiver::get() and
+ * Session::nextReceiver() to indicate that there no message was
+ * available before the timeout specified.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN NoMessageAvailable : public FetchError
{
QPID_MESSAGING_EXTERN NoMessageAvailable();
};
-struct SenderError : public LinkError
+struct QPID_MESSAGING_CLASS_EXTERN SenderError : public LinkError
{
QPID_MESSAGING_EXTERN SenderError(const std::string&);
};
-struct SendError : public SenderError
+struct QPID_MESSAGING_CLASS_EXTERN SendError : public SenderError
{
QPID_MESSAGING_EXTERN SendError(const std::string&);
};
-struct TargetCapacityExceeded : public SendError
+/**
+ * Thrown to indicate that the sender attempted to send a message that
+ * would result in the target node on the peer exceeding a
+ * preconfigured capacity.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN TargetCapacityExceeded : public SendError
{
QPID_MESSAGING_EXTERN TargetCapacityExceeded(const std::string&);
};
-struct SessionError : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN SessionError : public MessagingException
{
QPID_MESSAGING_EXTERN SessionError(const std::string&);
};
-struct TransactionError : public SessionError
+struct QPID_MESSAGING_CLASS_EXTERN TransactionError : public SessionError
{
QPID_MESSAGING_EXTERN TransactionError(const std::string&);
};
-struct TransactionAborted : public TransactionError
+/**
+ * Thrown on Session::commit() if reconnection results in the
+ * transaction being automatically aborted.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN TransactionAborted : public TransactionError
{
QPID_MESSAGING_EXTERN TransactionAborted(const std::string&);
};
-struct UnauthorizedAccess : public SessionError
+/**
+ * Thrown to indicate that the application attempted to do something
+ * for which it was not authorised by its peer.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN UnauthorizedAccess : public SessionError
{
QPID_MESSAGING_EXTERN UnauthorizedAccess(const std::string&);
};
-struct ConnectionError : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN ConnectionError : public MessagingException
{
QPID_MESSAGING_EXTERN ConnectionError(const std::string&);
};
-struct TransportFailure : public MessagingException
+/**
+ * Thrown to indicate loss of underlying connection. When
+ * auto-reconnect is used this will be caught by the library and used
+ * to trigger reconnection attempts. If reconnection fails (according
+ * to whatever settings have been configured), then an instnace of
+ * this class will be thrown to signal that.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN TransportFailure : public MessagingException
{
QPID_MESSAGING_EXTERN TransportFailure(const std::string&);
};