summaryrefslogtreecommitdiff
path: root/java/management
diff options
context:
space:
mode:
Diffstat (limited to 'java/management')
-rw-r--r--java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java2
-rw-r--r--java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java44
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java2
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java12
4 files changed, 57 insertions, 3 deletions
diff --git a/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java b/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java
index 7bc0e717b8..c6f7829e59 100644
--- a/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java
+++ b/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java
@@ -42,7 +42,7 @@ public interface ServerInformation
* Qpid JMX API 1.1 can be assumed.
*/
int QPID_JMX_API_MAJOR_VERSION = 1;
- int QPID_JMX_API_MINOR_VERSION = 6;
+ int QPID_JMX_API_MINOR_VERSION = 7;
/**
diff --git a/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java b/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
index 4a43071c3b..d83d534428 100644
--- a/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
+++ b/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
@@ -45,18 +45,37 @@ public interface UserManagement
* set password for user.
*
* Since Qpid JMX API 1.2 this operation expects plain text passwords to be provided. Prior to this, MD5 hashed passwords were supplied.
+ *
+ * @deprecated since Qpid JMX API 1.7
*
* @param username The username to create
* @param password The password for the user
*
* @return The result of the operation
*/
+ @Deprecated
@MBeanOperation(name = "setPassword", description = "Set password for user.",
impact = MBeanOperationInfo.ACTION)
boolean setPassword(@MBeanOperationParameter(name = "username", description = "Username")String username,
+ //NOTE: parameter name was changed to 'passwd' in Qpid JMX API 1.7 to protect against older, incompatible management clients
@MBeanOperationParameter(name = "passwd", description = "Password")char[] password);
/**
+ * Set password for a given user.
+ *
+ * @since Qpid JMX API 1.7
+ *
+ * @param username The username to create
+ * @param password The password for the user
+ *
+ * @return The result of the operation
+ */
+ @MBeanOperation(name = "setPassword", description = "Set password for user.",
+ impact = MBeanOperationInfo.ACTION)
+ boolean setPassword(@MBeanOperationParameter(name = "username", description = "Username")String username,
+ @MBeanOperationParameter(name = "password", description = "Password")String password);
+
+ /**
* set rights for users with given details
*
* @param username The username to create
@@ -78,6 +97,8 @@ public interface UserManagement
*
* Since Qpid JMX API 1.2 this operation expects plain text passwords to be provided. Prior to this, MD5 hashed passwords were supplied.
*
+ * @deprecated since Qpid JMX API 1.7
+ *
* @param username The username to create
* @param password The password for the user
* @param read The set of permission to give the new user
@@ -86,15 +107,38 @@ public interface UserManagement
*
* @return The result of the operation
*/
+ @Deprecated
@MBeanOperation(name = "createUser", description = "Create new user from system.",
impact = MBeanOperationInfo.ACTION)
boolean createUser(@MBeanOperationParameter(name = "username", description = "Username")String username,
+ //NOTE: parameter name was changed to 'passwd' in Qpid JMX API 1.7 to protect against older, incompatible management clients
@MBeanOperationParameter(name = "passwd", description = "Password")char[] password,
@MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
@MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
@MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
/**
+ * Create users with given details.
+ *
+ * @since Qpid JMX API 1.7
+ *
+ * @param username The username to create
+ * @param password The password for the user
+ * @param read The set of permission to give the new user
+ * @param write The set of permission to give the new user
+ * @param admin The set of permission to give the new user
+ *
+ * @return The result of the operation
+ */
+ @MBeanOperation(name = "createUser", description = "Create a new user.",
+ impact = MBeanOperationInfo.ACTION)
+ boolean createUser(@MBeanOperationParameter(name = "username", description = "Username")String username,
+ @MBeanOperationParameter(name = "password", description = "Password")String password,
+ @MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
+ @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
+ @MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
+
+ /**
* View users returns all the users that are currently available to the system.
*
* @param username The user to delete
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
index f3fc135efb..13485df718 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
@@ -47,7 +47,7 @@ public abstract class ApplicationRegistry
//max supported broker management interface supported by this release of the management console
public static final int SUPPORTED_QPID_JMX_API_MAJOR_VERSION = 1;
- public static final int SUPPORTED_QPID_JMX_API_MINOR_VERSION = 6;
+ public static final int SUPPORTED_QPID_JMX_API_MINOR_VERSION = 7;
public static final String DATA_DIR = System.getProperty("user.home") + File.separator + ".qpidmc";
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java
index 2051beafac..d7cd19e705 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/UserManagementTabControl.java
@@ -792,7 +792,17 @@ public class UserManagementTabControl extends TabControl
shell.dispose();
try
{
- boolean result = _ummb.createUser(username, passwordChars, read, write, admin);
+ boolean result = false;
+ // If we have Qpid JMX API 1.7 or above, use newer createUser method with String based password.
+ if (_ApiVersion.greaterThanOrEqualTo(1,7))
+ {
+ result = _ummb.createUser(username, password, read, write, admin);
+ }
+ else
+ {
+ result = _ummb.createUser(username, passwordChars, read, write, admin);
+ }
+
ViewUtility.operationResultFeedback(result, "Created user", "Failed to create user");
}
catch(Exception e5)