summaryrefslogtreecommitdiff
path: root/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/users/LegacySupportingUserManagement.java
blob: 0fc94a59726bd6025be31ebfc5e0953e2a08c4ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 */
package org.apache.qpid.management.ui.views.users;

import javax.management.MBeanOperationInfo;

import org.apache.qpid.management.common.mbeans.UserManagement;
import org.apache.qpid.management.common.mbeans.annotations.MBeanOperation;
import org.apache.qpid.management.common.mbeans.annotations.MBeanOperationParameter;

/**
 * UserManagement interface extension to provide the method signatures
 * for old UserManagement methods no longer supported by the broker.
 *
 * This interface is used only for the creation of MBean proxy objects
 * within the management console, for backwards compatibility with
 * functionality in older broker versions.
 */
public interface LegacySupportingUserManagement extends 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 for which the password is to be set
     * @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 rights for users with given details.
     * Since Qpid JMX API 2.3 all invocations will cause an exception to be thrown
     * as access rights can no longer be maintain via this interface.
     *
     * @deprecated since Qpid JMX API 2.3 / 1.12
     *
     * @param username The username to create
     * @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
     */
    @Deprecated
    @MBeanOperation(name = "setRights", description = "Set access rights for user.",
                    impact = MBeanOperationInfo.ACTION)
    boolean setRights(@MBeanOperationParameter(name = "username", description = "Username")String username,
                      @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 2.3 if the user passes true for parameters read, write, or admin, a
     * exception will be thrown as access rights can no longer be maintain via this interface.
     *
     * 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
     * @param write    The set of permission to give the new user
     * @param admin    The set of permission to give the new user
     *
     * @return true if the user was created successfully, or false otherwise
     */
    @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 2.3 if the user passes true for parameters read, write, or admin, a
     * exception will be thrown as access rights can no longer be maintain via this interface.
     *
     * @deprecated since Qpid JMX API 2.3 / 1.12
     * @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 true if the user was created successfully, or false otherwise
     */
    @Deprecated
    @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);

}