summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2013-03-19 18:39:50 +0000
committerAndrew Stitcher <astitcher@apache.org>2013-03-19 18:39:50 +0000
commit7bff7e411acefd6ba7abcbb36a4af2e5e064d2fc (patch)
tree2e27f7f0f31c9b05122eea81dd5b9ae308d85458
parent03883ac585b8ca2f3d295790cd54b5fde209a55d (diff)
downloadqpid-python-7bff7e411acefd6ba7abcbb36a4af2e5e064d2fc.tar.gz
QPID-4558: Change C++ Selector implementation to use registered values
- Selectors should now implement every language feature of the registered apache selector filter extension to the amqp 1.0 spec. - In the addressing syntax use a link property called just "selector" - For amqp 1.0 on the wire use the registered filter descriptor code for the selector. - For amqp 0-10 on the wire use a subscription property of "x-apache-selector" for the selector. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1458453 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/amqp/descriptors.h3
-rw-r--r--qpid/cpp/src/qpid/broker/SemanticState.cpp4
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Filter.cpp2
-rw-r--r--qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp9
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp6
5 files changed, 13 insertions, 11 deletions
diff --git a/qpid/cpp/src/qpid/amqp/descriptors.h b/qpid/cpp/src/qpid/amqp/descriptors.h
index 0a3e71fe6d..11bb7df6bb 100644
--- a/qpid/cpp/src/qpid/amqp/descriptors.h
+++ b/qpid/cpp/src/qpid/amqp/descriptors.h
@@ -78,10 +78,11 @@ const Descriptor SASL_OUTCOME(SASL_OUTCOME_CODE);
namespace filters {
const std::string LEGACY_DIRECT_FILTER_SYMBOL("apache.org:legacy-amqp-direct-binding:string");
const std::string LEGACY_TOPIC_FILTER_SYMBOL("apache.org:legacy-amqp-topic-binding:string");
-const std::string QPID_SELECTOR_FILTER_SYMBOL("qpid.apache.org:selector-filter:string");
+const std::string SELECTOR_FILTER_SYMBOL("apache.org:selector-filter:string");
const uint64_t LEGACY_DIRECT_FILTER_CODE(0x0000468C00000000ULL);
const uint64_t LEGACY_TOPIC_FILTER_CODE(0x0000468C00000001ULL);
+const uint64_t SELECTOR_FILTER_CODE(0x0000468C00000004ULL);
}
}} // namespace qpid::amqp
diff --git a/qpid/cpp/src/qpid/broker/SemanticState.cpp b/qpid/cpp/src/qpid/broker/SemanticState.cpp
index 60c2d6e555..275886c6e3 100644
--- a/qpid/cpp/src/qpid/broker/SemanticState.cpp
+++ b/qpid/cpp/src/qpid/broker/SemanticState.cpp
@@ -286,7 +286,7 @@ void SemanticState::record(const DeliveryRecord& delivery)
}
const std::string QPID_SYNC_FREQUENCY("qpid.sync_frequency");
-const std::string QPID_SELECTOR("qpid.selector");
+const std::string APACHE_SELECTOR("x-apache-selector");
SemanticStateConsumerImpl::SemanticStateConsumerImpl(SemanticState* _parent,
const string& _name,
@@ -309,7 +309,7 @@ Consumer(_name, type),
exclusive(_exclusive),
resumeId(_resumeId),
tag(_tag),
- selector(returnSelector(_arguments.getAsString(QPID_SELECTOR))),
+ selector(returnSelector(_arguments.getAsString(APACHE_SELECTOR))),
resumeTtl(_resumeTtl),
arguments(_arguments),
notifyEnabled(true),
diff --git a/qpid/cpp/src/qpid/broker/amqp/Filter.cpp b/qpid/cpp/src/qpid/broker/amqp/Filter.cpp
index 2984c2923a..bbe3330939 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Filter.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/Filter.cpp
@@ -61,7 +61,7 @@ void Filter::onStringValue(const qpid::amqp::CharSequence& key, const qpid::amqp
if (descriptor->match(qpid::amqp::filters::LEGACY_TOPIC_FILTER_SYMBOL, qpid::amqp::filters::LEGACY_TOPIC_FILTER_CODE)
|| descriptor->match(qpid::amqp::filters::LEGACY_DIRECT_FILTER_SYMBOL, qpid::amqp::filters::LEGACY_DIRECT_FILTER_CODE)) {
setSubjectFilter(filter);
- } else if (descriptor->match(qpid::amqp::filters::QPID_SELECTOR_FILTER_SYMBOL, 0)) {
+ } else if (descriptor->match(qpid::amqp::filters::SELECTOR_FILTER_SYMBOL, qpid::amqp::filters::SELECTOR_FILTER_CODE)) {
setSelectorFilter(filter);
} else {
QPID_LOG(notice, "Skipping unrecognised string filter with key " << filter.key << " and descriptor " << filter.descriptor);
diff --git a/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp b/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
index de6ee0cd2d..a9f2758605 100644
--- a/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
+++ b/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
@@ -93,7 +93,8 @@ const std::string DURABLE("durable");
const std::string X_DECLARE("x-declare");
const std::string X_SUBSCRIBE("x-subscribe");
const std::string X_BINDINGS("x-bindings");
-const std::string QPID_SELECTOR("qpid.selector");
+const std::string SELECTOR("selector");
+const std::string APACHE_SELECTOR("x-apache-selector");
const std::string EXCHANGE("exchange");
const std::string QUEUE("queue");
const std::string KEY("key");
@@ -477,8 +478,8 @@ QueueSource::QueueSource(const Address& address) :
//options)
exclusive = Opt(address)/LINK/X_SUBSCRIBE/EXCLUSIVE;
(Opt(address)/LINK/X_SUBSCRIBE/ARGUMENTS).collect(options);
- std::string selector = Opt(address)/LINK/QPID_SELECTOR;
- if (!selector.empty()) options.setString(QPID_SELECTOR, selector);
+ std::string selector = Opt(address)/LINK/SELECTOR;
+ if (!selector.empty()) options.setString(APACHE_SELECTOR, selector);
}
void QueueSource::subscribe(qpid::client::AsyncSession& session, const std::string& destination)
@@ -990,7 +991,7 @@ Verifier::Verifier()
link[X_SUBSCRIBE] = true;
link[X_DECLARE] = true;
link[X_BINDINGS] = true;
- link[QPID_SELECTOR] = true;
+ link[SELECTOR] = true;
defined[LINK] = link;
}
void Verifier::verify(const Address& address) const
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp
index 638b1fc674..e5f6738b61 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp
@@ -121,15 +121,15 @@ void ReceiverContext::configure(pn_terminus_t* source) const
}
// Look specifically for qpid.selector link property and add a filter for it
- qpid::types::Variant::Map::const_iterator i = helper.getLinkProperties().find("qpid.selector");
+ qpid::types::Variant::Map::const_iterator i = helper.getLinkProperties().find("selector");
if (i!=helper.getLinkProperties().end()) {
pn_data_t* filter = pn_terminus_filter(source);
pn_data_put_map(filter);
pn_data_enter(filter);
- pn_data_put_symbol(filter, convert("qpid.selector"));
+ pn_data_put_symbol(filter, convert("selector"));
pn_data_put_described(filter);
pn_data_enter(filter);
- pn_data_put_symbol(filter, convert(qpid::amqp::filters::QPID_SELECTOR_FILTER_SYMBOL));
+ pn_data_put_ulong(filter, qpid::amqp::filters::SELECTOR_FILTER_CODE);
pn_data_put_string(filter, convert(i->second));
pn_data_exit(filter);
pn_data_exit(filter);