diff options
author | Gordon Sim <gsim@apache.org> | 2006-12-05 17:43:00 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2006-12-05 17:43:00 +0000 |
commit | 722b16a1a7bbde82a4cd82c99a0e29d31d0545ca (patch) | |
tree | 4866c7dc7e3e85a9f62ce6512ee1a569a4882e20 /cpp/lib/broker/QueuePolicy.h | |
parent | 96aa6c6e76ffa946192778d69d36d4c372a0de7b (diff) | |
download | qpid-python-722b16a1a7bbde82a4cd82c99a0e29d31d0545ca.tar.gz |
Allow settings to be set and persisted for queues.
Define policy based on these settings.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@482723 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker/QueuePolicy.h')
-rw-r--r-- | cpp/lib/broker/QueuePolicy.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cpp/lib/broker/QueuePolicy.h b/cpp/lib/broker/QueuePolicy.h index 399c67d837..c31e9ec968 100644 --- a/cpp/lib/broker/QueuePolicy.h +++ b/cpp/lib/broker/QueuePolicy.h @@ -22,22 +22,31 @@ #define _QueuePolicy_ #include <BrokerMessage.h> +#include <FieldTable.h> namespace qpid { namespace broker { class QueuePolicy { + static const std::string maxCountKey; + static const std::string maxSizeKey; + const u_int32_t maxCount; const u_int64_t maxSize; u_int32_t count; u_int64_t size; + static int getInt(const qpid::framing::FieldTable& settings, const std::string& key, int defaultValue); bool checkCount(Message::shared_ptr& msg); bool checkSize(Message::shared_ptr& msg); public: QueuePolicy(u_int32_t maxCount, u_int64_t maxSize); + QueuePolicy(const qpid::framing::FieldTable& settings); void enqueued(Message::shared_ptr& msg, MessageStore* store); void dequeued(Message::shared_ptr& msg, MessageStore* store); + void update(qpid::framing::FieldTable& settings); + u_int32_t getMaxCount() const { return maxCount; } + u_int64_t getMaxSize() const { return maxSize; } }; } } |