Resolve a compilation error.
This commit is contained in:
Timothy Bish 2015-05-27 06:10:08 -04:00
parent ffcd99ac85
commit 17bcf43048
3 changed files with 95 additions and 4 deletions

View File

@ -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 + "}";
}
}

View File

@ -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;
}
}

View File

@ -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()));