summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-08-05 15:03:40 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-08-05 15:03:40 +0000
commit3f12c0a87eaab09e9084b17d21b7f4e793945908 (patch)
treecba532650bede8f916754f45a71c7dee9c4662c6 /qpid/java
parentd8519250038f95adcbc62948dfc2eed1348a83c0 (diff)
downloadqpid-python-3f12c0a87eaab09e9084b17d21b7f4e793945908.tar.gz
QPID-2786
Removed the checking for dest style and instead added support for providing the address name and subject is the exchange name and routing key is null. Otherwise we would have to modify the hashcode, equals methods etc to take the dest style into account. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@982652 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java48
1 files changed, 31 insertions, 17 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
index eb432d3318..5f3f4e7d19 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
@@ -106,20 +106,8 @@ public class AMQTopic extends AMQDestination implements Topic
public static AMQTopic createDurable010Topic(AMQTopic topic, String subscriptionName, AMQConnection connection)
throws JMSException
{
- if (topic.getDestSyntax() == AMQDestination.DestSyntax.BURL)
- {
- return new AMQTopic(topic.getExchangeName(), ExchangeDefaults.TOPIC_EXCHANGE_CLASS, topic.getRoutingKey(), true, false,
- getDurableTopicQueueName(subscriptionName, connection), true);
- }
- else
- {
- return new AMQTopic(new AMQShortString(topic.getAddressName()),
- ExchangeDefaults.TOPIC_EXCHANGE_CLASS,
- new AMQShortString(topic.getSubject()),
- true,
- false,
- getDurableTopicQueueName(subscriptionName, connection), true);
- }
+ return new AMQTopic(topic.getExchangeName(), ExchangeDefaults.TOPIC_EXCHANGE_CLASS, topic.getRoutingKey(), true, false,
+ getDurableTopicQueueName(subscriptionName, connection), true);
}
public static AMQShortString getDurableTopicQueueName(String subscriptionName, AMQConnection connection) throws JMSException
@@ -129,12 +117,39 @@ public class AMQTopic extends AMQDestination implements Topic
public String getTopicName() throws JMSException
{
- return super.getRoutingKey().toString();
+ if (super.getRoutingKey() == null && super.getSubject() != null)
+ {
+ return super.getSubject();
+ }
+ else
+ {
+ return super.getRoutingKey().toString();
+ }
+ }
+
+ @Override
+ public AMQShortString getExchangeName()
+ {
+ if (super.getExchangeName() == null && super.getAddressName() != null)
+ {
+ return new AMQShortString(super.getAddressName());
+ }
+ else
+ {
+ return _exchangeName;
+ }
}
public AMQShortString getRoutingKey()
{
- return super.getRoutingKey();
+ if (super.getRoutingKey() == null && super.getSubject() != null)
+ {
+ return new AMQShortString(super.getSubject());
+ }
+ else
+ {
+ return super.getRoutingKey();
+ }
}
public boolean isNameRequired()
@@ -160,7 +175,6 @@ public class AMQTopic extends AMQDestination implements Topic
return (o instanceof AMQTopic)
&& ((AMQTopic)o).getExchangeName().equals(getExchangeName())
&& ((AMQTopic)o).getRoutingKey().equals(getRoutingKey());
-
}
public int hashCode()