qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1488650 - in /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server: exchange/AbstractExchange.java exchange/DefaultExchange.java exchange/Exchange.java transport/ServerSessionDelegate.java
Date Sun, 02 Jun 2013 08:27:15 GMT
Author: rgodfrey
Date: Sun Jun  2 08:27:14 2013
New Revision: 1488650

URL: http://svn.apache.org/r1488650
Log:
QPID-4897 : [Java Broker] add ability to test for existence of binding purely on arguments

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSessionDelegate.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java?rev=1488650&r1=1488649&r2=1488650&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
Sun Jun  2 08:27:14 2013
@@ -255,6 +255,22 @@ public abstract class AbstractExchange i
         return false;
     }
 
+
+    public final boolean isBound(Map<String, Object> arguments)
+    {
+        for(Binding b : _bindings)
+        {
+            if(((b.getArguments() == null || b.getArguments().isEmpty())
+                                   ? (arguments == null || arguments.isEmpty())
+                                   : b.getArguments().equals(arguments)))
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
     @Override
     public final boolean isBound(String bindingKey, Map<String, Object> arguments)
     {

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java?rev=1488650&r1=1488649&r2=1488650&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchange.java
Sun Jun  2 08:27:14 2013
@@ -284,6 +284,12 @@ public class DefaultExchange implements 
     }
 
     @Override
+    public boolean isBound(Map<String, Object> arguments)
+    {
+        return (arguments == null || arguments.isEmpty()) && hasBindings();
+    }
+
+    @Override
     public boolean isBound(String bindingKey)
     {
         return _virtualHost.getQueueRegistry().getQueue(bindingKey) != null;

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java?rev=1488650&r1=1488649&r2=1488650&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
Sun Jun  2 08:27:14 2013
@@ -155,6 +155,8 @@ public interface Exchange extends Exchan
 
     boolean isBound(String bindingKey, Map<String, Object> arguments);
 
+    boolean isBound(Map<String, Object> arguments);
+
     void removeReference(ExchangeReferrer exchange);
 
     void addReference(ExchangeReferrer exchange);

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSessionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSessionDelegate.java?rev=1488650&r1=1488649&r2=1488650&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSessionDelegate.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSessionDelegate.java
Sun Jun  2 08:27:14 2013
@@ -1173,7 +1173,7 @@ public class ServerSessionDelegate exten
         }
         else if(exchange != null && method.hasArguments())
         {
-            result.setArgsNotMatched(!exchange.isBound(null, method.getArguments(), null));
+            result.setArgsNotMatched(!exchange.isBound(method.getArguments()));
         }
 
 



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


Mime
View raw message