You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2014/12/22 17:39:54 UTC

[6/7] qpid-jms git commit: consolodate on a single method to handle address prefixing, resolve defect of prefixing with null

consolodate on a single method to handle address prefixing, resolve defect of prefixing with null


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/5ef833a6
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/5ef833a6
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/5ef833a6

Branch: refs/heads/master
Commit: 5ef833a6b1140010872c64b2ba6e54766a78e21f
Parents: c6a5498
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Dec 22 15:50:23 2014 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Mon Dec 22 15:50:23 2014 +0000

----------------------------------------------------------------------
 .../qpid/jms/provider/amqp/AmqpConsumer.java    |  3 ++-
 .../jms/provider/amqp/AmqpFixedProducer.java    |  3 ++-
 .../qpid/jms/provider/amqp/AmqpSession.java     | 27 --------------------
 .../amqp/message/AmqpDestinationHelper.java     |  2 +-
 4 files changed, 5 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/5ef833a6/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java
index 19b4560..3319297 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java
@@ -35,6 +35,7 @@ import org.apache.qpid.jms.meta.JmsConsumerInfo;
 import org.apache.qpid.jms.provider.AsyncResult;
 import org.apache.qpid.jms.provider.ProviderConstants.ACK_TYPE;
 import org.apache.qpid.jms.provider.ProviderListener;
+import org.apache.qpid.jms.provider.amqp.message.AmqpDestinationHelper;
 import org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageBuilder;
 import org.apache.qpid.jms.util.IOExceptionSupport;
 import org.apache.qpid.proton.amqp.Binary;
@@ -138,7 +139,7 @@ public class AmqpConsumer extends AmqpAbstractResource<JmsConsumerInfo, Receiver
     @Override
     protected void doOpen() {
         JmsDestination destination  = resource.getDestination();
-        String subscription = session.getQualifiedName(destination);
+        String subscription = AmqpDestinationHelper.INSTANCE.getDestinationAddress(destination, session.getConnection());
 
         Source source = new Source();
         source.setAddress(subscription);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/5ef833a6/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
index 75fa850..d05824d 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
@@ -30,6 +30,7 @@ import org.apache.qpid.jms.message.JmsOutboundMessageDispatch;
 import org.apache.qpid.jms.message.facade.JmsMessageFacade;
 import org.apache.qpid.jms.meta.JmsProducerInfo;
 import org.apache.qpid.jms.provider.AsyncResult;
+import org.apache.qpid.jms.provider.amqp.message.AmqpDestinationHelper;
 import org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade;
 import org.apache.qpid.jms.util.IOExceptionSupport;
 import org.apache.qpid.proton.amqp.Binary;
@@ -238,7 +239,7 @@ public class AmqpFixedProducer extends AmqpProducer {
 
         if (resource.getDestination() != null) {
             JmsDestination destination = resource.getDestination();
-            targetAddress = session.getQualifiedName(destination);
+            targetAddress = AmqpDestinationHelper.INSTANCE.getDestinationAddress(destination, session.getConnection());
         }
 
         Symbol[] outcomes = new Symbol[]{Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL};

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/5ef833a6/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java
index d6e0abc..08c974b 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java
@@ -215,33 +215,6 @@ public class AmqpSession extends AmqpAbstractResource<JmsSessionInfo, Session> {
     }
 
     /**
-     * Adds Topic or Queue qualifiers to the destination target.  We don't add qualifiers to
-     * Temporary Topics and Queues since AMQP works a bit differently.
-     *
-     * @param destination
-     *        The destination to Qualify.
-     *
-     * @return the qualified destination name.
-     */
-    public String getQualifiedName(JmsDestination destination) {
-        if (destination == null) {
-            return null;
-        }
-
-        String result = destination.getName();
-
-        if (!destination.isTemporary()) {
-            if (destination.isTopic()) {
-                result = connection.getTopicPrefix() + destination.getName();
-            } else {
-                result = connection.getQueuePrefix() + destination.getName();
-            }
-        }
-
-        return result;
-    }
-
-    /**
      * Query the Session to see if there are any registered consumer instances that have
      * a durable subscription with the given subscription name.
      *

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/5ef833a6/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java
index e3eb84a..d04e403 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java
@@ -185,7 +185,7 @@ public class AmqpDestinationHelper {
         message.removeMessageAnnotation(REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME);
     }
 
-    private String getDestinationAddress(JmsDestination destination, AmqpConnection conn) {
+    public String getDestinationAddress(JmsDestination destination, AmqpConnection conn) {
         if (destination == null) {
             return null;
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org