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/16 13:39:26 UTC

[2/4] qpid-jms git commit: remove prefix configuration for temporary destinations, the names are generated by the peer and should always include the full address necessary

remove prefix configuration for temporary destinations, the names are generated by the peer and should always include the full address necessary


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

Branch: refs/heads/master
Commit: 4ec966358c3ad926fad1cdaeae29077fe4c8f4bc
Parents: bf2f51e
Author: Robert Gemmell <ro...@apache.org>
Authored: Tue Dec 16 10:41:53 2014 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Tue Dec 16 10:41:53 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/qpid/jms/JmsConnection.java | 16 -----------
 .../apache/qpid/jms/JmsConnectionFactory.java   | 28 --------------------
 .../apache/qpid/jms/meta/JmsConnectionInfo.java | 24 ++---------------
 .../qpid/jms/provider/amqp/AmqpConnection.java  |  2 --
 .../provider/amqp/AmqpTemporaryDestination.java |  8 +++---
 .../qpid/jms/meta/JmsConnectionInfoTest.java    |  4 ---
 6 files changed, 7 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4ec96635/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java
index 14fa2b3..042712e 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java
@@ -839,22 +839,6 @@ public class JmsConnection implements Connection, TopicConnection, QueueConnecti
         connectionInfo.setTopicPrefix(topicPrefix);
     }
 
-    public String getTempTopicPrefix() {
-        return connectionInfo.getTempTopicPrefix();
-    }
-
-    public void setTempTopicPrefix(String tempTopicPrefix) {
-        connectionInfo.setTempTopicPrefix(tempTopicPrefix);
-    }
-
-    public String getTempQueuePrefix() {
-        return connectionInfo.getTempQueuePrefix();
-    }
-
-    public void setTempQueuePrefix(String tempQueuePrefix) {
-        connectionInfo.setTempQueuePrefix(tempQueuePrefix);
-    }
-
     public String getQueuePrefix() {
         return connectionInfo.getQueuePrefix();
     }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4ec96635/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
index 72be74f..293749f 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
@@ -61,8 +61,6 @@ public class JmsConnectionFactory extends JNDIStorable implements ConnectionFact
     private boolean messagePrioritySupported = true;
     private String queuePrefix = "queue://";
     private String topicPrefix = "topic://";
-    private String tempQueuePrefix = "temp-queue://";
-    private String tempTopicPrefix = "temp-topic://";
     private long sendTimeout = JmsConnectionInfo.DEFAULT_SEND_TIMEOUT;
     private long requestTimeout = JmsConnectionInfo.DEFAULT_REQUEST_TIMEOUT;
     private long closeTimeout = JmsConnectionInfo.DEFAULT_CLOSE_TIMEOUT;
@@ -432,32 +430,6 @@ public class JmsConnectionFactory extends JNDIStorable implements ConnectionFact
     }
 
     /**
-     * Returns the prefix applied to Temporary Queues that are created by the client.
-     *
-     * @return the currently configured Temporary Queue prefix.
-     */
-    public String getTempQueuePrefix() {
-        return tempQueuePrefix;
-    }
-
-    public void setTempQueuePrefix(String tempQueuePrefix) {
-        this.tempQueuePrefix = tempQueuePrefix;
-    }
-
-    /**
-     * Returns the prefix applied to Temporary Topics that are created by the client.
-     *
-     * @return the currently configured Temporary Topic prefix.
-     */
-    public String getTempTopicPrefix() {
-        return tempTopicPrefix;
-    }
-
-    public void setTempTopicPrefix(String tempTopicPrefix) {
-        this.tempTopicPrefix = tempTopicPrefix;
-    }
-
-    /**
      * Returns the prefix applied to Topics that are created by the client.
      *
      * @return the currently configured Topic prefix.

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4ec96635/qpid-jms-client/src/main/java/org/apache/qpid/jms/meta/JmsConnectionInfo.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/meta/JmsConnectionInfo.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/meta/JmsConnectionInfo.java
index 4d42b10..9ae8e32 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/meta/JmsConnectionInfo.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/meta/JmsConnectionInfo.java
@@ -43,10 +43,8 @@ public final class JmsConnectionInfo implements JmsResource, Comparable<JmsConne
     public long requestTimeout = DEFAULT_REQUEST_TIMEOUT;
     public long connectTimeout = DEFAULT_CONNECT_TIMEOUT;
     public long closeTimeout = DEFAULT_CLOSE_TIMEOUT;
-    private String queuePrefix = "/queue/";
-    private String topicPrefix = "/topic/";
-    private String tempQueuePrefix = "/temp-queue/";
-    private String tempTopicPrefix = "/temp-topic/";
+    private String queuePrefix = "/queue/";//TODO: use null? It is defaulted/configured elsewhere to a different value.
+    private String topicPrefix = "/topic/";//TODO: use null? It is defaulted/configured elsewhere to a different value.
 
     public JmsConnectionInfo(JmsConnectionId connectionId) {
         if (connectionId == null) {
@@ -75,8 +73,6 @@ public final class JmsConnectionInfo implements JmsResource, Comparable<JmsConne
         copy.closeTimeout = closeTimeout;
         copy.queuePrefix = queuePrefix;
         copy.topicPrefix = topicPrefix;
-        copy.tempQueuePrefix = tempQueuePrefix;
-        copy.tempTopicPrefix = tempTopicPrefix;
         copy.connectTimeout = connectTimeout;
     }
 
@@ -156,22 +152,6 @@ public final class JmsConnectionInfo implements JmsResource, Comparable<JmsConne
         this.topicPrefix = topicPrefix;
     }
 
-    public String getTempQueuePrefix() {
-        return tempQueuePrefix;
-    }
-
-    public void setTempQueuePrefix(String tempQueuePrefix) {
-        this.tempQueuePrefix = tempQueuePrefix;
-    }
-
-    public String getTempTopicPrefix() {
-        return tempTopicPrefix;
-    }
-
-    public void setTempTopicPrefix(String tempTopicPrefix) {
-        this.tempTopicPrefix = tempTopicPrefix;
-    }
-
     public long getCloseTimeout() {
         return closeTimeout;
     }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4ec96635/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
index 2badbcd..7ee95be 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
@@ -76,8 +76,6 @@ public class AmqpConnection extends AmqpAbstractResource<JmsConnectionInfo, Conn
 
         this.queuePrefix = info.getQueuePrefix();
         this.topicPrefix = info.getTopicPrefix();
-        this.tempQueuePrefix = info.getTempQueuePrefix();
-        this.tempTopicPrefix = info.getTempTopicPrefix();
 
         // Create a Session for this connection that is used for Temporary Destinations
         // and perhaps later on management and advisory monitoring.

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4ec96635/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpTemporaryDestination.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpTemporaryDestination.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpTemporaryDestination.java
index fca448d..10496b0 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpTemporaryDestination.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpTemporaryDestination.java
@@ -84,16 +84,18 @@ public class AmqpTemporaryDestination extends AmqpAbstractResource<JmsDestinatio
 
     @Override
     protected void doOpen() {
-
+        //TODO: debug what this is actually doing, then likely replace with a generated Source name.
         String sourceAddress = resource.getName();
+        String tempQueuePrefix = "temp-queue://";
         if (resource.isQueue()) {
-            sourceAddress = connection.getTempQueuePrefix() + sourceAddress;
+            sourceAddress = tempQueuePrefix + sourceAddress;
         } else {
             // TODO - AMQ doesn't support temp topics so we make everything a temp queue for now
-            sourceAddress = connection.getTempQueuePrefix() + sourceAddress;
+            sourceAddress = tempQueuePrefix + sourceAddress;
         }
         Source source = new Source();
         source.setAddress(sourceAddress);
+
         Target target = new Target();
         target.setDynamic(true);
         target.setDurable(TerminusDurability.NONE);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4ec96635/qpid-jms-client/src/test/java/org/apache/qpid/jms/meta/JmsConnectionInfoTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/meta/JmsConnectionInfoTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/meta/JmsConnectionInfoTest.java
index 86b75bf..75bc241 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/meta/JmsConnectionInfoTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/meta/JmsConnectionInfoTest.java
@@ -71,8 +71,6 @@ public class JmsConnectionInfoTest {
         info.setQueuePrefix("queue");
         info.setRequestTimeout(50);
         info.setSendTimeout(150);
-        info.setTempQueuePrefix("tempQueue");
-        info.setTempTopicPrefix("tempTopic");
         info.setTopicPrefix("topic");
         info.setUsername("user");
         info.setWatchRemoteDestinations(false);
@@ -90,8 +88,6 @@ public class JmsConnectionInfoTest {
         assertEquals("queue", copy.getQueuePrefix());
         assertEquals(50, copy.getRequestTimeout());
         assertEquals(150, copy.getSendTimeout());
-        assertEquals("tempQueue", copy.getTempQueuePrefix());
-        assertEquals("tempTopic", copy.getTempTopicPrefix());
         assertEquals("topic", copy.getTopicPrefix());
         assertEquals("user", copy.getUsername());
         assertEquals(false, copy.isWatchRemoteDestinations());


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