summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/QueueSettings.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-07-10 13:47:05 +0000
committerGordon Sim <gsim@apache.org>2013-07-10 13:47:05 +0000
commit04ad679eb369aac2a49dbccfeaeaa5964e688dd8 (patch)
treed7d482d9ca24a6922698034b1b66f56b7645e4d0 /cpp/src/qpid/broker/QueueSettings.cpp
parented030b2309b484610bc3aca3c9b978cea1f6d00b (diff)
downloadqpid-python-04ad679eb369aac2a49dbccfeaeaa5964e688dd8.tar.gz
QPID-4976: support standard lifetime policies
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1501768 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/QueueSettings.cpp')
-rw-r--r--cpp/src/qpid/broker/QueueSettings.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/QueueSettings.cpp b/cpp/src/qpid/broker/QueueSettings.cpp
index 5a149c1c6d..fd90d11d76 100644
--- a/cpp/src/qpid/broker/QueueSettings.cpp
+++ b/cpp/src/qpid/broker/QueueSettings.cpp
@@ -58,6 +58,9 @@ const std::string PAGING("qpid.paging");
const std::string MAX_PAGES("qpid.max_pages_loaded");
const std::string PAGE_FACTOR("qpid.page_factor");
const std::string FILTER("qpid.filter");
+const std::string LIFETIME_POLICY("qpid.lifetime-policy");
+const std::string DELETE_IF_UNUSED_KEY("delete-if-unused");
+const std::string DELETE_IF_UNUSED_AND_EMPTY_KEY("delete-if-unused-and-empty");
const std::string LVQ_LEGACY("qpid.last_value_queue");
const std::string LVQ_LEGACY_KEY("qpid.LVQ_key");
@@ -86,6 +89,7 @@ const QueueSettings::Aliases QueueSettings::aliases;
QueueSettings::QueueSettings(bool d, bool a) :
durable(d),
autodelete(a),
+ lifetime(DELETE_IF_UNUSED),
isTemporary(false),
priorities(0),
defaultFairshare(0),
@@ -214,6 +218,15 @@ bool QueueSettings::handle(const std::string& key, const qpid::types::Variant& v
} else if (key == FILTER) {
filter = value.asString();
return true;
+ } else if (key == LIFETIME_POLICY) {
+ if (value.asString() == DELETE_IF_UNUSED_KEY) {
+ lifetime = DELETE_IF_UNUSED;
+ } else if (value.asString() == DELETE_IF_UNUSED_AND_EMPTY_KEY) {
+ lifetime = DELETE_IF_UNUSED_AND_EMPTY;
+ } else {
+ QPID_LOG(warning, "Invalid value for " << LIFETIME_POLICY << ": " << value);
+ }
+ return true;
} else {
return false;
}