Repository: activemq Updated Branches: refs/heads/master ffcd99ac8 -> 17bcf4304
https://issues.apache.org/jira/browse/AMQ-5799 Resolve a compilation error. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/17bcf430 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/17bcf430 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/17bcf430 Branch: refs/heads/master Commit: 17bcf43048b96ed407296ebb25639930dac3795e Parents: ffcd99a Author: Timothy Bish <[email protected]> Authored: Wed May 27 06:10:08 2015 -0400 Committer: Timothy Bish <[email protected]> Committed: Wed May 27 06:10:08 2015 -0400 ---------------------------------------------------------------------- .../amqp/protocol/AmqpJmsSelectorFilter.java | 48 ++++++++++++++++++++ .../amqp/protocol/AmqpNoLocalFilter.java | 45 ++++++++++++++++++ .../transport/amqp/protocol/AmqpSession.java | 6 +-- 3 files changed, 95 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/17bcf430/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpJmsSelectorFilter.java ---------------------------------------------------------------------- diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpJmsSelectorFilter.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpJmsSelectorFilter.java new file mode 100644 index 0000000..7bce660 --- /dev/null +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpJmsSelectorFilter.java @@ -0,0 +1,48 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file 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 KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.transport.amqp.protocol; + +import static org.apache.activemq.transport.amqp.AmqpSupport.JMS_SELECTOR_CODE; + +import org.apache.qpid.proton.amqp.DescribedType; + +/** + * A Described Type wrapper for JMS selector values. + */ +public class AmqpJmsSelectorFilter implements DescribedType { + + private final String selector; + + public AmqpJmsSelectorFilter(String selector) { + this.selector = selector; + } + + @Override + public Object getDescriptor() { + return JMS_SELECTOR_CODE; + } + + @Override + public Object getDescribed() { + return this.selector; + } + + @Override + public String toString() { + return "AmqpJmsSelectorType{" + selector + "}"; + } +} http://git-wip-us.apache.org/repos/asf/activemq/blob/17bcf430/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpNoLocalFilter.java ---------------------------------------------------------------------- diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpNoLocalFilter.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpNoLocalFilter.java new file mode 100644 index 0000000..f2ee589 --- /dev/null +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpNoLocalFilter.java @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file 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 KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.transport.amqp.protocol; + +import static org.apache.activemq.transport.amqp.AmqpSupport.NO_LOCAL_CODE; + +import org.apache.qpid.proton.amqp.DescribedType; + +/** + * A Described Type wrapper for JMS no local option for MessageConsumer. + */ +public class AmqpNoLocalFilter implements DescribedType { + + public static final AmqpNoLocalFilter NO_LOCAL = new AmqpNoLocalFilter(); + + private final String noLocal; + + public AmqpNoLocalFilter() { + this.noLocal = "NoLocalFilter{}"; + } + + @Override + public Object getDescriptor() { + return NO_LOCAL_CODE; + } + + @Override + public Object getDescribed() { + return this.noLocal; + } +} http://git-wip-us.apache.org/repos/asf/activemq/blob/17bcf430/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSession.java ---------------------------------------------------------------------- diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSession.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSession.java index ff106fd..ca3a90f 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSession.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSession.java @@ -45,8 +45,6 @@ import org.apache.activemq.selector.SelectorParser; import org.apache.activemq.transport.amqp.AmqpProtocolConverter; import org.apache.activemq.transport.amqp.AmqpProtocolException; import org.apache.activemq.transport.amqp.ResponseHandler; -import org.apache.qpid.jms.provider.amqp.AmqpJmsNoLocalType; -import org.apache.qpid.jms.provider.amqp.AmqpJmsSelectorType; import org.apache.qpid.proton.amqp.DescribedType; import org.apache.qpid.proton.amqp.Symbol; import org.apache.qpid.proton.amqp.messaging.Target; @@ -271,11 +269,11 @@ public class AmqpSession implements AmqpResource { source.setDistributionMode(COPY); if (storedInfo.isNoLocal()) { - supportedFilters.put(NO_LOCAL_NAME, AmqpJmsNoLocalType.NO_LOCAL); + supportedFilters.put(NO_LOCAL_NAME, AmqpNoLocalFilter.NO_LOCAL); } if (storedInfo.getSelector() != null && !storedInfo.getSelector().trim().equals("")) { - supportedFilters.put(JMS_SELECTOR_NAME, new AmqpJmsSelectorType(storedInfo.getSelector())); + supportedFilters.put(JMS_SELECTOR_NAME, new AmqpJmsSelectorFilter(storedInfo.getSelector())); } } else { sender.close(new ErrorCondition(AmqpError.NOT_FOUND, "Unknown subscription link: " + protonSender.getName()));
