KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > security > management > UserManagerJmxAdapter


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.security.management;
19
20 import java.util.Collection JavaDoc;
21 import java.util.Map JavaDoc;
22 import java.util.Set JavaDoc;
23
24 import org.sape.carbon.core.component.FunctionalInterface;
25
26 /**
27  * Service used to provide JMX management of the user store.
28  *
29  * <p>
30  * Since the standard UserManager service has strongly typed parameters on
31  * all of its method, a default JMX console cannot effectively administer
32  * the user store. This interface provides methods to administer the
33  * UserStore that uses only simple java parameters. All returned values
34  * can have their <code>toString</code> method called to get back useful
35  * information.
36  * </p>
37  *
38  * @author $Author: dvoet $ $Date: 2003/10/28 19:02:00 $
39  * @version $Revision: 1.6 $
40  *
41  * @stereotype interface
42  * @since carbon 1.2
43  */

44 public interface UserManagerJmxAdapter extends FunctionalInterface {
45     /**
46      * Creates a new user in the datastore given the name and password.
47      * Since the adapter only takes simple java types, only the simple
48      * plaintext password is accepted. This interface does not support
49      * certificates, bio-metric information, or any other type of
50      * complicated credentail.
51      *
52      * @param userName name of the new user to add
53      * @param password the password to associated with the user
54      *
55      * @throws DuplicatePrincipalException indicates the user already
56      * exists
57      */

58     void createUser(String JavaDoc userName, Map JavaDoc userInfo)
59         throws DuplicatePrincipalException, SecurityManagementDataStoreException;
60
61     /**
62      * Removes a user from the datastore with the given username.
63      *
64      * @param userName name of the new user to remove
65      *
66      * @throws UnknownPrincipalException indicates the principalName given
67      * does not represent a user
68      */

69     void removeUser(String JavaDoc userName)
70         throws UnknownPrincipalException, SecurityManagementDataStoreException;
71
72     /**
73      * Updates the password for an existing user. Since the adapter only
74      * takes simple java types, only the simple plaintext password is
75      * accepted. This interface does not support certificates,
76      * bio-metric information, or any other type of complicated
77      * credentail.
78      *
79      * @param userName name of the new user to add
80      * @param password the password to associated with the user
81      *
82      * @throws UnknownPrincipalException indicates the principalName given
83      * does not represent a user
84      */

85     void updatePassword(String JavaDoc userName, String JavaDoc password)
86         throws UnknownPrincipalException, SecurityManagementDataStoreException;
87
88     /**
89      * Creates a new group with the given user name.
90      *
91      * @param groupName the name of the new group to create
92      *
93      * @throws DuplicateGroupException indicates a group with the given
94      * principal already exists in this user store.
95      */

96     void createGroup(String JavaDoc groupName)
97         throws DuplicateGroupException, SecurityManagementDataStoreException;
98
99     /**
100      * Removes a group with the given name.
101      *
102      * @param groupName the name of the group to remove
103      *
104      * @throws UnknownGroupException indicates the group does not exist in
105      * the user store.
106      */

107     void removeGroup(String JavaDoc groupName)
108         throws UnknownGroupException, SecurityManagementDataStoreException;
109
110     /**
111      * Adds a user to a group.
112      *
113      * @param userName name of the new user to add to the group
114      * @param groupName the name of the group to add to
115      *
116      * @return if use the user store has changed
117      *
118      * @throws UnknownPrincipalException indicates the principalName given
119      * does not represent a user
120      */

121     boolean addUserToGroup(String JavaDoc userName, String JavaDoc groupName)
122         throws UnknownPrincipalException, SecurityManagementDataStoreException;
123
124     /**
125      * Adds a group to a group.
126      *
127      * @param childGroupName name of the child group to add to parent
128      * @param parentGroupName the name of the group to add to
129      *
130      * @return if use the user store has changed
131      *
132      * @throws UnknownPrincipalException indicates the principalName given
133      * does not represent a user
134      * @throws UnknownGroupException indicates the group does not exist in
135      * the user store.
136      */

137     boolean addGroupToGroup(String JavaDoc childGroupName, String JavaDoc parentGroupName)
138         throws
139             UnknownPrincipalException,
140             UnknownGroupException,
141             SecurityManagementDataStoreException;
142
143     /**
144      * Removes a user from a group.
145      *
146      * @param userName name of the new user to remove from the group
147      * @param groupName the name of the group to remove from
148      *
149      * @return if use the user store has changed
150      *
151      * @throws UnknownPrincipalException indicates the principalName given
152      * does not represent a user
153      * @throws UnknownGroupException indicates the group does not exist in
154      * the user store.
155      */

156     boolean removeUserFromGroup(String JavaDoc userName, String JavaDoc groupName)
157         throws
158             UnknownPrincipalException,
159             UnknownGroupException,
160             SecurityManagementDataStoreException;
161
162     /**
163      * Removes a group from a group.
164      *
165      * @param childGroupName name of the child group to remove from parent
166      * @param parentGroupName the name of the group to from from
167      *
168      * @return if use the user store has changed
169      *
170      * @throws UnknownPrincipalException indicates the principalName given
171      * does not represent a user
172      * @throws UnknownGroupException indicates the group does not exist in
173      * the user store.
174      */

175     boolean removeGroupFromGroup(String JavaDoc childGroupName, String JavaDoc parentGroupName)
176         throws
177             UnknownGroupException,
178             UnknownPrincipalException,
179             SecurityManagementDataStoreException;
180
181     /**
182      * Retreives all names of the members (users and groups) of a group.
183      *
184      * @param groupName name of the group to return
185      *
186      * @return all member names as Strings
187      *
188      * @throws UnknownGroupException indicates the group does not exist in
189      * the user store.
190      */

191     Collection JavaDoc retreiveAllMemberNames(String JavaDoc groupName)
192         throws UnknownGroupException, SecurityManagementDataStoreException;
193
194     /**
195      * Retreives all user names in the system.
196      *
197      * @return all user names in the system as Strings
198      */

199     Set JavaDoc retreiveAllUserNames() throws SecurityManagementDataStoreException;
200
201     /**
202      * Retreives all group names in the system.
203      *
204      * @return all group names in the system as Strings
205      */

206     Set JavaDoc retreiveAllGroupNames() throws SecurityManagementDataStoreException;
207 }
208
Popular Tags