summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2013-08-21 02:00:50 +0000
committerRobert Godfrey <rgodfrey@apache.org>2013-08-21 02:00:50 +0000
commit1b476c06272af18c808caf8b719ab74d82863bae (patch)
tree110ec67286a57220abdb666647f8667d31821a83 /qpid/java/broker-plugins
parent6266c91a9ef891c84159c99cfc7708fc2cc7d49f (diff)
downloadqpid-python-1b476c06272af18c808caf8b719ab74d82863bae.tar.gz
QPID-5088 : [Java Broker] Isolate use of AMQShortString and FieldTable to 0-8/9/9-1 protocol specific plugins
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1516058 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
-rw-r--r--qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java10
-rwxr-xr-xqpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaData_0_10.java5
-rw-r--r--qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java5
-rw-r--r--qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java21
-rw-r--r--qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Subscription_0_10.java4
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java6
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/IncomingMessage.java5
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/SubscriptionImpl.java2
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java8
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java2
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java5
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java8
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java15
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java10
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java2
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java4
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java2
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java2
-rw-r--r--qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java5
-rw-r--r--qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java4
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java9
21 files changed, 54 insertions, 80 deletions
diff --git a/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java b/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java
index 181d693614..cc93c540df 100644
--- a/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java
+++ b/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java
@@ -42,7 +42,7 @@ import org.apache.qpid.test.utils.QpidTestCase;
* The ruleset is configured directly rather than using an external file by adding rules individually, calling the
* {@link RuleSet#grant(Integer, String, Permission, Operation, ObjectType, ObjectProperties)} method. Then, the
* access control mechanism is validated by checking whether operations would be authorised by calling the
- * {@link RuleSet#check(Principal, Operation, ObjectType, ObjectProperties)} method.
+ * {@link RuleSet#check(Subject, Operation, ObjectType, ObjectProperties)} method.
*
* It ensure that permissions can be granted correctly on users directly and on groups.
*/
@@ -53,9 +53,9 @@ public class RuleSetTest extends QpidTestCase
private static final String TEST_USER = "user";
// Common things that are passed to frame constructors
- private AMQShortString _queueName = new AMQShortString(this.getClass().getName() + "queue");
- private AMQShortString _exchangeName = new AMQShortString("amq.direct");
- private AMQShortString _exchangeType = new AMQShortString("direct");
+ private String _queueName = this.getClass().getName() + "queue";
+ private String _exchangeName = "amq.direct";
+ private String _exchangeType = "direct";
private Subject _testSubject = TestPrincipalUtils.createTestSubject(TEST_USER);
@Override
@@ -116,7 +116,7 @@ public class RuleSetTest extends QpidTestCase
public void testExchangeCreate()
{
ObjectProperties properties = new ObjectProperties(_exchangeName);
- properties.put(ObjectProperties.Property.TYPE, _exchangeType.asString());
+ properties.put(ObjectProperties.Property.TYPE, _exchangeType);
assertDenyGrantAllow(_testSubject, Operation.CREATE, ObjectType.EXCHANGE, properties);
}
diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaData_0_10.java b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaData_0_10.java
index ee2a40a5b2..092ea7c3c9 100755
--- a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaData_0_10.java
+++ b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaData_0_10.java
@@ -182,11 +182,6 @@ public class MessageMetaData_0_10 implements StorableMessageMetaData, InboundMes
return _deliveryProps == null ? null : _deliveryProps.getRoutingKey();
}
- public AMQShortString getRoutingKeyShortString()
- {
- return AMQShortString.valueOf(getRoutingKey());
- }
-
public AMQMessageHeader getMessageHeader()
{
return _messageHeader;
diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java
index 4e8bfcb652..e5914d1d4e 100644
--- a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java
+++ b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java
@@ -52,11 +52,6 @@ public class MessageTransferMessage extends AbstractServerMessageImpl<MessageMet
return getMetaData().getRoutingKey();
}
- public AMQShortString getRoutingKeyShortString()
- {
- return AMQShortString.valueOf(getRoutingKey());
- }
-
public AMQMessageHeader getMessageHeader()
{
return getMetaData().getMessageHeader();
diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
index 60211823f8..46626e3e92 100644
--- a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
+++ b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
@@ -37,12 +37,9 @@ import org.apache.qpid.server.model.Queue;
import org.apache.qpid.server.model.UUIDGenerator;
import org.apache.qpid.server.plugin.ExchangeType;
import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
import org.apache.qpid.server.queue.BaseQueue;
import org.apache.qpid.server.queue.QueueArgumentsConverter;
-import org.apache.qpid.server.queue.QueueRegistry;
import org.apache.qpid.server.security.SecurityManager;
-import org.apache.qpid.server.store.DurableConfigurationStoreHelper;
import org.apache.qpid.server.store.DurableConfigurationStore;
import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.store.StoreFuture;
@@ -701,11 +698,11 @@ public class ServerSessionDelegate extends SessionDelegate
}
else
{
- if (!exchange.getTypeShortString().toString().equals(method.getType())
+ if (!exchange.getTypeName().equals(method.getType())
&& (method.getType() != null && method.getType().length() > 0))
{
exception(session, method, ExecutionErrorCode.NOT_ALLOWED, "Attempt to redeclare exchange: "
- + exchangeName + " of type " + exchange.getTypeShortString() + " to " + method.getType() + ".");
+ + exchangeName + " of type " + exchange.getTypeName() + " to " + method.getType() + ".");
}
}
}
@@ -738,11 +735,11 @@ public class ServerSessionDelegate extends SessionDelegate
catch(ExchangeExistsException e)
{
Exchange exchange = e.getExistingExchange();
- if(!exchange.getTypeShortString().toString().equals(method.getType()))
+ if(!exchange.getTypeName().equals(method.getType()))
{
exception(session, method, ExecutionErrorCode.NOT_ALLOWED,
"Attempt to redeclare exchange: " + exchangeName
- + " of type " + exchange.getTypeShortString()
+ + " of type " + exchange.getTypeName()
+ " to " + method.getType() +".");
}
else if(method.hasAlternateExchange()
@@ -891,7 +888,7 @@ public class ServerSessionDelegate extends SessionDelegate
{
for(ExchangeType type : registeredTypes)
{
- if(type.getDefaultExchangeName().toString().equals( exchange.getName() ))
+ if(type.getDefaultExchangeName().equals( exchange.getName() ))
{
return true;
}
@@ -910,7 +907,7 @@ public class ServerSessionDelegate extends SessionDelegate
if(exchange != null)
{
result.setDurable(exchange.isDurable());
- result.setType(exchange.getTypeShortString().toString());
+ result.setType(exchange.getTypeName());
result.setNotFound(false);
}
else
@@ -953,9 +950,9 @@ public class ServerSessionDelegate extends SessionDelegate
{
exception(session, method, ExecutionErrorCode.NOT_FOUND, "Exchange: '" + method.getExchange() + "' not found");
}
- else if(exchange.getTypeShortString().equals(HeadersExchange.TYPE.getName()) && (!method.hasArguments() || method.getArguments() == null || !method.getArguments().containsKey("x-match")))
+ else if(exchange.getType().equals(HeadersExchange.TYPE) && (!method.hasArguments() || method.getArguments() == null || !method.getArguments().containsKey("x-match")))
{
- exception(session, method, ExecutionErrorCode.INTERNAL_ERROR, "Bindings to an exchange of type " + HeadersExchange.TYPE.getName() + " require an x-match header");
+ exception(session, method, ExecutionErrorCode.INTERNAL_ERROR, "Bindings to an exchange of type " + HeadersExchange.TYPE.getType() + " require an x-match header");
}
else
{
@@ -1422,7 +1419,7 @@ public class ServerSessionDelegate extends SessionDelegate
if(queue != null)
{
- result.setQueue(queue.getNameShortString().toString());
+ result.setQueue(queue.getName());
result.setDurable(queue.isDurable());
result.setExclusive(queue.isExclusive());
result.setAutoDelete(queue.isAutoDelete());
diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Subscription_0_10.java b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Subscription_0_10.java
index 63582702cb..77b63906cc 100644
--- a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Subscription_0_10.java
+++ b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Subscription_0_10.java
@@ -600,7 +600,7 @@ public class Subscription_0_10 implements Subscription, FlowCreditManager.FlowCr
//output operational logging for each delivery post commit
for (final BaseQueue destinationQueue : destinationQueues)
{
- logActor.message( ChannelMessages.DEADLETTERMSG(msg.getMessageNumber(), destinationQueue.getNameShortString().asString()));
+ logActor.message( ChannelMessages.DEADLETTERMSG(msg.getMessageNumber(), destinationQueue.getName()));
}
}
}
@@ -875,7 +875,7 @@ public class Subscription_0_10 implements Subscription, FlowCreditManager.FlowCr
public String toLogString()
{
String queueInfo = MessageFormat.format(QUEUE_FORMAT, _queue.getVirtualHost().getName(),
- _queue.getNameShortString());
+ _queue.getName());
String result = "[" + MessageFormat.format(SUBSCRIPTION_FORMAT, getSubscriptionID()) + "("
// queueString is "vh(/{0})/qu({1}) " so need to trim
+ queueInfo.substring(0, queueInfo.length() - 1) + ")" + "] ";
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
index 6867ee7bb5..a603807f87 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
@@ -1396,7 +1396,7 @@ public class AMQChannel implements AMQSessionModel, AsyncAutoCommitTransaction.F
_message,
_channelId,
_errorCode.getCode(),
- AMQShortString.valueOf(_description, true, true));
+ AMQShortString.validValueOf(_description));
}
catch (AMQException e)
{
@@ -1449,7 +1449,7 @@ public class AMQChannel implements AMQSessionModel, AsyncAutoCommitTransaction.F
if(_blocking.compareAndSet(false,true))
{
- _actor.message(_logSubject, ChannelMessages.FLOW_ENFORCED(queue.getNameShortString().toString()));
+ _actor.message(_logSubject, ChannelMessages.FLOW_ENFORCED(queue.getName()));
flow(false);
}
}
@@ -1568,7 +1568,7 @@ public class AMQChannel implements AMQSessionModel, AsyncAutoCommitTransaction.F
//output operational logging for each delivery post commit
for (final BaseQueue destinationQueue : destinationQueues)
{
- _actor.message(_logSubject, ChannelMessages.DEADLETTERMSG(msg.getMessageNumber(), destinationQueue.getNameShortString().asString()));
+ _actor.message(_logSubject, ChannelMessages.DEADLETTERMSG(msg.getMessageNumber(), destinationQueue.getName()));
}
}
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/IncomingMessage.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/IncomingMessage.java
index 90c764daac..5267651a66 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/IncomingMessage.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/IncomingMessage.java
@@ -129,11 +129,6 @@ public class IncomingMessage implements Filterable, InboundMessage, EnqueableMes
return _messagePublishInfo.getExchange();
}
- public AMQShortString getRoutingKeyShortString()
- {
- return _messagePublishInfo.getRoutingKey();
- }
-
public String getRoutingKey()
{
return _messagePublishInfo.getRoutingKey() == null ? null : _messagePublishInfo.getRoutingKey().toString();
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/SubscriptionImpl.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/SubscriptionImpl.java
index 5803135b16..d1d86fe478 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/SubscriptionImpl.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/SubscriptionImpl.java
@@ -349,7 +349,7 @@ public abstract class SubscriptionImpl implements Subscription, FlowCreditManage
_noLocal = noLocal;
- _filters = FilterManagerFactory.createManager(arguments);
+ _filters = FilterManagerFactory.createManager(FieldTable.convertToMap(arguments));
_deliveryMethod = deliveryMethod;
_recordMethod = recordMethod;
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java
index 4e620327c9..836de44f4e 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java
@@ -102,13 +102,13 @@ public class BasicConsumeMethodHandler implements StateAwareMethodListener<Basic
if (session == null || session.getConnectionModel() != protocolConnection)
{
throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
- "Queue " + queue.getNameShortString() + " is exclusive, but not created on this Connection.");
+ "Queue " + queue.getName() + " is exclusive, but not created on this Connection.");
}
}
if (body.getConsumerTag() != null)
{
- consumerTagName = body.getConsumerTag().intern();
+ consumerTagName = body.getConsumerTag().intern(false);
}
else
{
@@ -160,14 +160,14 @@ public class BasicConsumeMethodHandler implements StateAwareMethodListener<Basic
{
throw body.getChannelException(AMQConstant.ACCESS_REFUSED,
"Cannot subscribe to queue "
- + queue.getNameShortString()
+ + queue.getName()
+ " as it already has an existing exclusive consumer");
}
catch (AMQQueue.ExistingSubscriptionPreventsExclusive e)
{
throw body.getChannelException(AMQConstant.ACCESS_REFUSED,
"Cannot subscribe to queue "
- + queue.getNameShortString()
+ + queue.getName()
+ " exclusively as it already has a consumer");
}
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java
index 96936dc429..497e97db3e 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java
@@ -63,7 +63,7 @@ public class BasicPublishMethodHandler implements StateAwareMethodListener<Basic
// TODO: check the delivery tag field details - is it unique across the broker or per subscriber?
if (exchangeName == null)
{
- exchangeName = ExchangeDefaults.DEFAULT_EXCHANGE_NAME;
+ exchangeName = AMQShortString.valueOf(ExchangeDefaults.DEFAULT_EXCHANGE_NAME);
}
VirtualHost vHost = session.getVirtualHost();
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java
index ba5692fc6c..0535236f94 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java
@@ -149,7 +149,8 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo
}
else
{
- if (exchange.isBound(body.getRoutingKey(), queue))
+ String bindingKey = body.getRoutingKey() == null ? null : body.getRoutingKey().asString();
+ if (exchange.isBound(bindingKey, queue))
{
response = methodRegistry.createExchangeBoundOkBody(OK, // replyCode
@@ -172,7 +173,7 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo
}
else
{
- if (exchange.isBound(body.getRoutingKey()))
+ if (exchange.isBound(body.getRoutingKey() == null ? "" : body.getRoutingKey().asString()))
{
response = methodRegistry.createExchangeBoundOkBody(OK, // replyCode
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java
index 4949fcd62b..154c38a4bf 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java
@@ -79,11 +79,11 @@ public class ExchangeDeclareHandler implements StateAwareMethodListener<Exchange
{
throw body.getChannelException(AMQConstant.NOT_FOUND, "Unknown exchange: " + exchangeName);
}
- else if (!exchange.getTypeShortString().equals(body.getType()) && !(body.getType() == null || body.getType().length() ==0))
+ else if (!(body.getType() == null || body.getType().length() ==0) && !exchange.getTypeName().equals(body.getType().asString()))
{
throw new AMQConnectionException(AMQConstant.NOT_ALLOWED, "Attempt to redeclare exchange: " +
- exchangeName + " of type " + exchange.getTypeShortString()
+ exchangeName + " of type " + exchange.getTypeName()
+ " to " + body.getType() +".",body.getClazz(), body.getMethod(),body.getMajor(),body.getMinor(),null);
}
@@ -110,11 +110,11 @@ public class ExchangeDeclareHandler implements StateAwareMethodListener<Exchange
catch(ExchangeExistsException e)
{
exchange = e.getExistingExchange();
- if(!exchange.getTypeShortString().equals(body.getType()))
+ if(!new AMQShortString(exchange.getTypeName()).equals(body.getType()))
{
throw new AMQConnectionException(AMQConstant.NOT_ALLOWED, "Attempt to redeclare exchange: "
+ exchangeName + " of type "
- + exchange.getTypeShortString()
+ + exchange.getTypeName()
+ " to " + body.getType() +".",
body.getClazz(), body.getMethod(),
body.getMajor(), body.getMinor(),null);
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java
index 359bd2eb19..d95d59f75f 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java
@@ -30,6 +30,8 @@ import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.framing.MethodRegistry;
import org.apache.qpid.framing.QueueBindBody;
import org.apache.qpid.protocol.AMQConstant;
+import org.apache.qpid.server.exchange.TopicExchange;
+import org.apache.qpid.server.plugin.ExchangeType;
import org.apache.qpid.server.protocol.v0_8.AMQChannel;
import org.apache.qpid.server.binding.Binding;
import org.apache.qpid.server.exchange.Exchange;
@@ -86,7 +88,7 @@ public class QueueBindHandler implements StateAwareMethodListener<QueueBindBody>
if (body.getRoutingKey() == null)
{
- routingKey = queue.getNameShortString();
+ routingKey = AMQShortString.valueOf(queue.getName());
}
else
{
@@ -119,16 +121,17 @@ public class QueueBindHandler implements StateAwareMethodListener<QueueBindBody>
if (session == null || session.getConnectionModel() != protocolConnection)
{
throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
- "Queue " + queue.getNameShortString() + " is exclusive, but not created on this Connection.");
+ "Queue " + queue.getName() + " is exclusive, but not created on this Connection.");
}
}
- if (!exch.isBound(routingKey, body.getArguments(), queue))
+ Map<String,Object> arguments = FieldTable.convertToMap(body.getArguments());
+ String bindingKey = String.valueOf(routingKey);
+
+ if (!exch.isBound(bindingKey, arguments, queue))
{
- String bindingKey = String.valueOf(routingKey);
- Map<String,Object> arguments = FieldTable.convertToMap(body.getArguments());
- if(!exch.addBinding(bindingKey, queue, arguments) && ExchangeDefaults.TOPIC_EXCHANGE_CLASS.equals(exch.getTypeShortString()))
+ if(!exch.addBinding(bindingKey, queue, arguments) && TopicExchange.TYPE.equals(exch.getType()))
{
Binding oldBinding = exch.getBinding(bindingKey, queue, arguments);
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java
index fd547d4bac..3fdce83c2a 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java
@@ -102,7 +102,7 @@ public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclar
&& (owningSession == null || owningSession.getConnectionModel() != protocolConnection))
{
throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
- "Queue " + queue.getNameShortString() + " is exclusive, but not created on this Connection.");
+ "Queue " + queue.getName() + " is exclusive, but not created on this Connection.");
}
//set this as the default queue on the channel:
@@ -153,13 +153,13 @@ public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclar
if (queue.isExclusive() && !queue.isDurable() && (owningSession == null || owningSession.getConnectionModel() != protocolConnection))
{
throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
- "Queue " + queue.getNameShortString() + " is exclusive, but not created on this Connection.");
+ "Queue " + queue.getName() + " is exclusive, but not created on this Connection.");
}
else if(queue.isExclusive() != body.getExclusive())
{
throw body.getChannelException(AMQConstant.ALREADY_EXISTS,
- "Cannot re-declare queue '" + queue.getNameShortString() + "' with different exclusivity (was: "
+ "Cannot re-declare queue '" + queue.getName() + "' with different exclusivity (was: "
+ queue.isExclusive() + " requested " + body.getExclusive() + ")");
}
else if (body.getExclusive() && !(queue.isDurable() ? String.valueOf(queue.getOwner()).equals(session.getClientID()) : (owningSession == null || owningSession.getConnectionModel() == protocolConnection)))
@@ -173,13 +173,13 @@ public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclar
else if(queue.isAutoDelete() != body.getAutoDelete())
{
throw body.getChannelException(AMQConstant.ALREADY_EXISTS,
- "Cannot re-declare queue '" + queue.getNameShortString() + "' with different auto-delete (was: "
+ "Cannot re-declare queue '" + queue.getName() + "' with different auto-delete (was: "
+ queue.isAutoDelete() + " requested " + body.getAutoDelete() + ")");
}
else if(queue.isDurable() != body.getDurable())
{
throw body.getChannelException(AMQConstant.ALREADY_EXISTS,
- "Cannot re-declare queue '" + queue.getNameShortString() + "' with different durability (was: "
+ "Cannot re-declare queue '" + queue.getName() + "' with different durability (was: "
+ queue.isDurable() + " requested " + body.getDurable() + ")");
}
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java
index a39faf2e70..d3c196a789 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java
@@ -108,7 +108,7 @@ public class QueueDeleteHandler implements StateAwareMethodListener<QueueDeleteB
if (queue.isExclusive() && !queue.isDurable() && (session == null || session.getConnectionModel() != protocolConnection))
{
throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
- "Queue " + queue.getNameShortString() + " is exclusive, but not created on this Connection.");
+ "Queue " + queue.getName() + " is exclusive, but not created on this Connection.");
}
int purged = virtualHost.removeQueue(queue);
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java
index 20405b82ab..d568e0f581 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java
@@ -80,13 +80,13 @@ public class QueueUnbindHandler implements StateAwareMethodListener<QueueUnbindB
throw body.getChannelException(AMQConstant.NOT_FOUND, "No default queue defined on channel and queue was null");
}
- routingKey = body.getRoutingKey() == null ? null : body.getRoutingKey().intern();
+ routingKey = body.getRoutingKey() == null ? null : body.getRoutingKey().intern(false);
}
else
{
queue = virtualHost.getQueue(body.getQueue().toString());
- routingKey = body.getRoutingKey() == null ? null : body.getRoutingKey().intern();
+ routingKey = body.getRoutingKey() == null ? null : body.getRoutingKey().intern(false);
}
if (queue == null)
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java
index a9eb0ebfe7..43f88ca2a3 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java
@@ -126,7 +126,7 @@ public class AcknowledgeTest extends QpidTestCase
BrokerTestHelper_0_8.publishMessages(getChannel(),
sendMessageCount,
_queueName,
- ExchangeDefaults.DEFAULT_EXCHANGE_NAME.asString());
+ ExchangeDefaults.DEFAULT_EXCHANGE_NAME);
if (getChannel().isTransactional())
{
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java
index 21142e7ab6..4f9df3b38d 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java
@@ -99,7 +99,7 @@ public class QueueBrowserUsesNoAckTest extends QpidTestCase
BrokerTestHelper_0_8.publishMessages(getChannel(),
sendMessageCount,
_queueName,
- ExchangeDefaults.DEFAULT_EXCHANGE_NAME.asString());
+ ExchangeDefaults.DEFAULT_EXCHANGE_NAME);
//Ensure they are stored
checkStoreContents(sendMessageCount);
diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
index 9dc063e3ea..68e9a88b0b 100644
--- a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
+++ b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
@@ -97,11 +97,6 @@ public class Message_1_0 implements ServerMessage<MessageMetaData_1_0>, InboundM
}
}
- public AMQShortString getRoutingKeyShortString()
- {
- return AMQShortString.valueOf(getRoutingKey());
- }
-
private MessageMetaData_1_0 getMessageMetaData()
{
return _storedMessage.getMetaData();
diff --git a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java
index c14896079f..e832ef7569 100644
--- a/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java
+++ b/qpid/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v0_10/MessageConverter_0_10_to_0_8.java
@@ -92,8 +92,8 @@ public class MessageConverter_0_10_to_0_8 implements MessageConverter<MessageTra
Exchange exchange = vhost.getExchange(exchangeName);
String exchangeClass = exchange == null
- ? ExchangeDefaults.DIRECT_EXCHANGE_CLASS.asString()
- : exchange.getType().getName().asString();
+ ? ExchangeDefaults.DIRECT_EXCHANGE_CLASS
+ : exchange.getTypeName();
props.setReplyTo(exchangeClass + "://" + exchangeName + "//?routingkey='" + (routingKey == null
? ""
: routingKey + "'"));
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
index 9614ded3d8..42eecb28ac 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
@@ -219,14 +219,7 @@ public abstract class AbstractServlet extends HttpServlet
}
finally
{
- try
- {
- SecurityManager.setThreadSubject(null);
- }
- finally
- {
- AMQShortString.clearLocalCache();
- }
+ SecurityManager.setThreadSubject(null);
}
}