qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhupend...@apache.org
Subject svn commit: r533101 - in /incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui: Constants.java jmx/JMXServerRegistry.java model/OperationData.java views/OperationTabControl.java
Date Fri, 27 Apr 2007 14:02:35 GMT
Author: bhupendrab
Date: Fri Apr 27 07:02:34 2007
New Revision: 533101

URL: http://svn.apache.org/viewvc?view=rev&rev=533101
Log:
Merged revisions 533065 via svnmerge from https://svn.apache.org/repos/asf/incubator/qpid/branches/M2
........
  r533065 | bhupendrab | 2007-04-27 12:17:39 +0100 (Fri, 27 Apr 2007) | 1 line
  QPID-471
........

Modified:
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java?view=diff&rev=533101&r1=533100&r2=533101
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
(original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
Fri Apr 27 07:02:34 2007
@@ -60,6 +60,7 @@
     public final static String OPERATION_MOVE_MESSAGES = "moveMessages";
     
     public final static String OPERATION_CREATEUSER = "createUser";
+    public final static String OPERATION_DELETEUSER = "deleteUser";
     public final static String OPERATION_VIEWUSERS = "viewUsers";
     public final static String OPERATION_PARAM_USERNAME = "username";
     

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java?view=diff&rev=533101&r1=533100&r2=533101
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
(original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
Fri Apr 27 07:02:34 2007
@@ -25,6 +25,7 @@
 import java.lang.reflect.Constructor;
 import java.security.Security;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -581,6 +582,7 @@
     public void setUserList(List<String> list)
     {
         _usersList = list;
+        Collections.sort(_usersList);
     }
     
     public List<String> getUsernames()

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java?view=diff&rev=533101&r1=533100&r2=533101
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
(original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
Fri Apr 27 07:02:34 2007
@@ -89,4 +89,22 @@
     {
         return (_returnType.equals("void") || _returnType.equals("java.lang.Void"));
     }
+    
+    public Object getParameterValue(String paramName)
+    {
+        if (_parameters == null)
+        {
+            return null;
+        }
+        
+        for (int i = 0; i < _parameters.size(); i++)
+        {
+            if (paramName.equalsIgnoreCase(_parameters.get(i).getName()))
+            {
+                return _parameters.get(i).getValue();
+            }
+        }
+        
+        return null;
+    }
 }

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java?view=diff&rev=533101&r1=533100&r2=533101
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
(original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
Fri Apr 27 07:02:34 2007
@@ -278,8 +278,7 @@
             {
                 items = EXCHANGE_TYPE_VALUES;
             }
-            else if (_mbean.isAdmin() && param.getName().equals(OPERATION_PARAM_USERNAME)
-                                      && !_opData.getName().equals(OPERATION_CREATEUSER))
+            else if (isUserListParameter(param))
             {
                 List<String> list = ApplicationRegistry.getServerRegistry(_mbean).getUsernames();
                 if (list != null && !list.isEmpty())
@@ -361,6 +360,17 @@
         }
     }
     
+    private boolean isUserListParameter(ParameterData param)
+    {
+        if (_mbean.isAdmin() && param.getName().equals(OPERATION_PARAM_USERNAME)
+                && !_opData.getName().equals(OPERATION_CREATEUSER))
+        {
+            return true;
+        }
+        
+        return false;
+    }
+    
     /**
      * Creates customized dispaly for a method "CreateNewBinding" for Headers exchange
      *
@@ -624,8 +634,16 @@
             {
                 executeAndShowResults();
             }
-            clearParameters();
-            clearParameterValues(_paramsComposite);
+            
+            if (_mbean.isAdmin() && _opData.getName().equals(OPERATION_DELETEUSER))
+            {
+                refresh(_mbean);
+            }
+            else
+            {
+                clearParameters();
+                clearParameterValues(_paramsComposite);
+            }
         }
     }
     
@@ -659,9 +677,32 @@
          * Here we are adding the users to a list, which will be used to list username to
be selected on
          * pages like "delete user", "set password" instead of typing the username
         */
-        if (_mbean.isAdmin() && _opData.getName().equals(OPERATION_VIEWUSERS))
+        if (_mbean.isAdmin())
         {
-            ApplicationRegistry.getServerRegistry(_mbean).setUserList(extractUserList(result));
+            if (_opData.getName().equals(OPERATION_VIEWUSERS))
+            {
+                ApplicationRegistry.getServerRegistry(_mbean).setUserList(extractUserList(result));
+            }
+            else if (_opData.getName().equals(OPERATION_DELETEUSER))
+            {
+                List<String> list = ApplicationRegistry.getServerRegistry(_mbean).getUsernames();
+                Object userName = _opData.getParameterValue(OPERATION_PARAM_USERNAME);
+                if ((list != null) && !list.isEmpty() && (userName != null))
+                {
+                    list.remove(userName);
+                    ApplicationRegistry.getServerRegistry(_mbean).setUserList(list);
+                }                
+            }
+            else if (_opData.getName().equals(OPERATION_CREATEUSER))
+            {
+                List<String> list = ApplicationRegistry.getServerRegistry(_mbean).getUsernames();
+                Object userName = _opData.getParameterValue(OPERATION_PARAM_USERNAME);
+                if ((list != null) && !list.isEmpty() && (userName != null))
+                {
+                    list.add(userName.toString());
+                    ApplicationRegistry.getServerRegistry(_mbean).setUserList(list);
+                }                
+            }
         }
         // end of custom code
         
@@ -710,7 +751,7 @@
         {
             list.add(data.get(USERNAME).toString());
         }
-        Collections.sort(list);
+        
         return list;
     }
     



Mime
View raw message