qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fad...@apache.org
Subject svn commit: r1619775 - in /qpid/branches/0.30/qpid/tools/src/java: qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/ qpid-qmf2-tools/src/main/java/org/apache/qpid/qmf2/tools/
Date Fri, 22 Aug 2014 12:13:41 GMT
Author: fadams
Date: Fri Aug 22 12:13:40 2014
New Revision: 1619775

URL: http://svn.apache.org/r1619775
Log:
QPID-6025: Fix NPE bug on java QpidConfig port

Modified:
    qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Binding.java
    qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Exchange.java
    qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Queue.java
    qpid/branches/0.30/qpid/tools/src/java/qpid-qmf2-tools/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java

Modified: qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Binding.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Binding.java?rev=1619775&r1=1619774&r2=1619775&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Binding.java
(original)
+++ qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Binding.java
Fri Aug 22 12:13:40 2014
@@ -22,6 +22,7 @@
 package org.apache.qpid.server.qmf2.agentdata;
 
 // Misc Imports
+import java.util.Collections;
 import java.util.Map;
 
 // Simple Logging Facade 4 Java
@@ -118,11 +119,16 @@ public class Binding extends QmfAgentDat
         setValue("bindingKey", binding.getName());
 
         Map<String, Object> arguments = binding.getArguments();
-        // Only add arguments property if the bindings have arguments
+        // Only add arguments property if the bindings have arguments otherwise
+        // set to empty Map to be consistent with C++ Broker.
         if (arguments != null && arguments.size() > 0)
         {
             setValue("arguments", arguments);
         }
+        else
+        {
+            setValue("arguments", Collections.EMPTY_MAP);
+        }
         // origin not implemented in Java Broker - not really sure what the origin property
means anyway???
     }
 

Modified: qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Exchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Exchange.java?rev=1619775&r1=1619774&r2=1619775&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Exchange.java
(original)
+++ qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Exchange.java
Fri Aug 22 12:13:40 2014
@@ -147,7 +147,9 @@ public class Exchange extends QmfAgentDa
         setValue("durable", _exchange.isDurable());
         setValue("autoDelete", autoDelete);
 
-        // TODO altExchange and arguments properties.
+        // TODO figure out mapping from Java Broker model to QMF exchange arguments.
+        // Set to empty Map for now to be consistent with C++ broker.
+        setValue("arguments", Collections.EMPTY_MAP);
 
         // ObjectId needs to be set here in Exchange because the QMF2 version of qpid-config
uses a hardcoded
         // _object_name as below in the _object_id that it sets in the getExchange() call
and in exchangeRef.

Modified: qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Queue.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Queue.java?rev=1619775&r1=1619774&r2=1619775&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Queue.java
(original)
+++ qpid/branches/0.30/qpid/tools/src/java/qpid-broker-plugins-management-qmf2/src/main/java/org/apache/qpid/server/qmf2/agentdata/Queue.java
Fri Aug 22 12:13:40 2014
@@ -163,8 +163,9 @@ public class Queue extends QmfAgentData
         // altExchange needs to be set later, done in mapEncode() for convenience, because
it isn't set during
         // Queue construction in the Java Broker.
 
-        // TODO arguments properties.
-
+        // TODO figure out mapping from Java Broker model to QMF queue arguments.
+        // Set to empty Map for now to be consistent with C++ broker.
+        setValue("arguments", Collections.EMPTY_MAP);
 
         // ObjectId needs to be set here in Queue because the QMF2 version of qpid-config
uses a hardcoded
         // _object_name as below in the _object_id that it sets in the getQueue() call and
in queueRef.

Modified: qpid/branches/0.30/qpid/tools/src/java/qpid-qmf2-tools/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/tools/src/java/qpid-qmf2-tools/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java?rev=1619775&r1=1619774&r2=1619775&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/tools/src/java/qpid-qmf2-tools/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java
(original)
+++ qpid/branches/0.30/qpid/tools/src/java/qpid-qmf2-tools/src/main/java/org/apache/qpid/qmf2/tools/QpidConfig.java
Fri Aug 22 12:13:40 2014
@@ -30,6 +30,7 @@ import java.io.FileNotFoundException;
 import java.io.InputStreamReader;
 import java.io.IOException;
 
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.Arrays;
@@ -526,6 +527,7 @@ public final class QpidConfig
             {
                 System.out.printf("%-10s%-" + maxNameLen + "s ", exchange.getStringValue("type"),
name);
                 Map args = (Map)exchange.getValue("arguments");
+                args = (args == null) ? Collections.EMPTY_MAP : args;
 
                 if (exchange.getBooleanValue("durable"))
                 {
@@ -599,7 +601,7 @@ public final class QpidConfig
 
                         String bindingKey = binding.getStringValue("bindingKey");
                         Map arguments = (Map)binding.getValue("arguments");
-                        if (arguments.isEmpty())
+                        if (arguments == null || arguments.isEmpty())
                         {
                             System.out.printf("    bind [%s] => %s\n", bindingKey, queueName);
                         }
@@ -657,6 +659,7 @@ public final class QpidConfig
             {
                 System.out.printf("%-" + maxNameLen + "s ", name);
                 Map<String, Object> args = queue.<Map<String, Object>>getValue("arguments");
+                args = (args == null) ? Collections.EMPTY_MAP : args;
 /*System.out.println(args);
 for (Map.Entry<String, Object> entry  : args.entrySet()) {
     System.out.println(entry.getKey() + " " + entry.getValue().getClass().getCanonicalName());
@@ -803,7 +806,7 @@ for (Map.Entry<String, Object> entry  : 
 
                         String bindingKey = binding.getStringValue("bindingKey");
                         Map arguments = (Map)binding.getValue("arguments");
-                        if (arguments.isEmpty())
+                        if (arguments == null || arguments.isEmpty())
                         {
                             System.out.printf("    bind [%s] => %s\n", bindingKey, exchangeName);
                         }



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


Mime
View raw message