summaryrefslogtreecommitdiff
path: root/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java')
-rw-r--r--qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java43
1 files changed, 30 insertions, 13 deletions
diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
index 36ad1b4fdc..11df1b6f00 100644
--- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
+++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
@@ -33,8 +33,6 @@ import static org.apache.qpid.management.ui.Constants.*;
import org.apache.qpid.management.ui.ApplicationRegistry;
import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.jmx.JMXServerRegistry;
import org.apache.qpid.management.ui.jmx.MBeanUtility;
import org.apache.qpid.management.ui.model.OperationData;
import org.apache.qpid.management.ui.model.ParameterData;
@@ -69,8 +67,6 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Control class for the MBean operations tab. It creates the required widgets
* for the selected MBean.
- * @author Bhupendra Bhardwaj
- * @author Robert Gemmell
*/
public class OperationTabControl extends TabControl
{
@@ -521,7 +517,7 @@ public class OperationTabControl extends TabControl
private void populateResults(Object result)
{
Display display = Display.getCurrent();
- int width = 600;
+ int width = 610;
int height = 400;
Shell shell = ViewUtility.createPopupShell(RESULT, width, height);
shell.setImage(ApplicationRegistry.getImage(CONSOLE_IMAGE));
@@ -605,23 +601,37 @@ public class OperationTabControl extends TabControl
return;
}
- // customized for passwords
- if (PASSWORD.equalsIgnoreCase(param.getName()))
+ //Custom handling for the PASSWORD field
+ if (param.getName().equalsIgnoreCase(PASSWORD))
{
+ //Convert the String value to a character array if that is what is required.
if (param.getType().equals("[C"))
{
- try
+ // Retreive the mBean type and version.
+ // If we have a version 1 UserManagement class mbean then it expects the password
+ // to be sent as the hashed version.
+ if (_mbean.getType().equals("UserManagement") && _mbean.getVersion() == 1)
{
- param.setValue(ViewUtility.getHash((String)param.getValue()));
+ try
+ {
+ param.setValue(ViewUtility.getHash((String) param.getValue()));
+ }
+ catch (Exception hashException)
+ {
+ ViewUtility.popupErrorMessage(_form.getText(),
+ "Unable to calculate hash for Password:"
+ + hashException.getMessage());
+ return;
+ }
}
- catch (Exception ex)
+ else
{
- MBeanUtility.handleException(_mbean, ex);
- return;
+ param.setValue(((String) param.getValue()).toCharArray());
}
}
}
// end of customization
+
}
}
@@ -725,7 +735,14 @@ public class OperationTabControl extends TabControl
{
boolean success = Boolean.parseBoolean(result.toString());
String message = success ? OPERATION_SUCCESSFUL : OPERATION_UNSUCCESSFUL;
- ViewUtility.popupInfoMessage(title, message);
+ if(success)
+ {
+ ViewUtility.popupInfoMessage(title, message);
+ }
+ else
+ {
+ ViewUtility.popupErrorMessage(title, message);
+ }
}
else if (_opData.getParameters() != null && !_opData.getParameters().isEmpty())
{