KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mr > kernel > security > impl > management > ACLManagement


1 /*
2  * Copyright 2002 by
3  * <a HREF="http://www.coridan.com">Coridan</a>
4  * <a HREF="mailto: support@coridan.com ">support@coridan.com</a>
5  *
6  * The contents of this file are subject to the Mozilla Public License Version
7  * 1.1 (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  * http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is "MantaRay" (TM).
17  *
18  * The Initial Developer of the Original Code is Shirley Sasson.
19  * Portions created by the Initial Developer are Copyright (C) 2006
20  * Coridan Inc. All Rights Reserved.
21  *
22  * Contributor(s): all the names of the contributors are added in the source
23  * code where applicable.
24  *
25  * Alternatively, the contents of this file may be used under the terms of the
26  * LGPL license (the "GNU LESSER GENERAL PUBLIC LICENSE"), in which case the
27  * provisions of LGPL are applicable instead of those above. If you wish to
28  * allow use of your version of this file only under the terms of the LGPL
29  * License and not to allow others to use your version of this file under
30  * the MPL, indicate your decision by deleting the provisions above and
31  * replace them with the notice and other provisions required by the LGPL.
32  * If you do not delete the provisions above, a recipient may use your version
33  * of this file under either the MPL or the GNU LESSER GENERAL PUBLIC LICENSE.
34
35  *
36  * This library is free software; you can redistribute it and/or modify it
37  * under the terms of the MPL as stated above or under the terms of the GNU
38  * Lesser General Public License as published by the Free Software Foundation;
39  * either version 2.1 of the License, or any later version.
40  *
41  * This library is distributed in the hope that it will be useful, but WITHOUT
42  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
43  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
44  * License for more details.
45  */

46
47 package org.mr.kernel.security.impl.management;
48
49 import org.mr.kernel.security.authorization.permissions.MantaPermission;
50
51 import java.util.Collection JavaDoc;
52
53 import org.mr.kernel.security.*;
54
55 import javax.jms.JMSSecurityException JavaDoc;
56
57 /**
58  * This interface is used by a Manta client to perform management actions, such as creating a permission, deleting a
59  * principal, etc.
60  * The implementing class will implement the actual management actions.
61  *
62  * Each method recives the session ID of the authenticated user that logged in for performing these actions, and the session ID
63  * is used to authorized the client to perform the actions.
64  *
65  * @version 1.0
66  * @since Apr 11, 2006
67  * @author Shirley Sasson
68  *
69  */

70 public interface ACLManagement {
71
72
73     /**
74      * Creates a new principal.
75      *
76      * @param sessionID the session id returned from MantaAuthentication.authenticate method
77      * @param principal the principal to add
78      * @throws PrincipalAlreadyExistsException if this pricipal already exists
79      * @throws PrincipalNotFoundException if the principal to create is a user and the group specified for the
80      * user, doesn't exist
81      * @throws MantaSecurityException if an error occured
82      * @throws JMSSecurityException if action is unauthorized for the specific client
83      *
84      */

85     public void createPrincipal(SessionID sessionID, MantaPrincipal principal) throws PrincipalAlreadyExistsException, PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc;
86
87     /**
88      * Renames a principal.
89      *
90      * @param sessionID the session id returned from MantaAuthentication.authenticate method
91      * @param principal the principal to rename
92      * @throws PrincipalNotFoundException if a principal with the same name already exists
93      * @throws PrincipalAlreadyExistsException if this pricipal already exists
94      * @throws MantaSecurityException if an error occured
95      * @throws JMSSecurityException if action is unauthorized for the specific client
96      *
97      */

98     public void renamePrincipal(SessionID sessionID, MantaPrincipal principal, String JavaDoc newName) throws PrincipalNotFoundException, PrincipalAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc;
99
100     /**
101      * Sets a group of a user.
102      *
103      * @param sessionID the session id returned from MantaAuthentication.authenticate method
104      * @param user the user to set the group for
105      * @param groupName the name of the group to set
106      * @throws PrincipalNotFoundException if user is not found or if group is not found
107      * @throws MantaSecurityException if an error occured
108      * @throws JMSSecurityException if action is unauthorized for the specific client
109      *
110      */

111     public void setUserGroup(SessionID sessionID, UserPrincipal user, String JavaDoc groupName) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc;
112
113     /**
114      * Sets the password of for a user.
115      *
116      * @param sessionID the session id returned from MantaAuthentication.authenticate method
117      * @param user the user to set the group for
118      * @param password the password to set
119      * @throws PrincipalNotFoundException if user is not found
120      * @throws MantaSecurityException if an error occured
121      * @throws JMSSecurityException if action is unauthorized for the specific client
122      *
123      */

124     public void setUserPassword(SessionID sessionID, UserPrincipal user, String JavaDoc password) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc;
125
126     /**
127      * Creates a new permission.
128      *
129      * @param sessionID the session id returned from MantaAuthentication.authenticate method
130      * @param permission the permission to add
131      * @throws PrincipalNotFoundException if the principal is not found
132      * @throws PermissionAlreadyExistsException if this permission already exists
133      * @throws MantaSecurityException if an error occured
134      * @throws JMSSecurityException if action is unauthorized for the specific client
135      *
136      */

137     public void createPermission(SessionID sessionID, MantaPermission permission, MantaPrincipal principal) throws PrincipalNotFoundException, PermissionAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc;
138
139     /**
140      * Returns the list of all permissions for a specific principal.
141      *
142      * @param sessionID the session id returned from MantaAuthentication.authenticate method
143      * @param principal the principal
144      * @return a list of all permissions for a specific principal
145      * @throws PrincipalNotFoundException if the principal specified doesn't exist
146      * @throws MantaSecurityException if an error occured
147      * @throws JMSSecurityException if action is unauthorized for the specific client
148      *
149      */

150     public Collection JavaDoc getPermissionsForPrincipal(SessionID sessionID, MantaPrincipal principal) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc;
151
152     /**
153      * Deletes a principal.
154      *
155      * @param sessionID the session id returned from MantaAuthentication.authenticate method
156      * @param principal the principal to delete
157      * @throws PrincipalNotFoundException if this pricipal is not found
158      * @throws GroupNotEmptyException if the principal to delete is a group which has users related to it and so cannot be deleted
159      * @throws MantaSecurityException if an error occured
160      * @throws JMSSecurityException if action is unauthorized for the specific client
161      *
162      */

163     public void deletePrincipal(SessionID sessionID, MantaPrincipal principal) throws PrincipalNotFoundException, GroupNotEmptyException, MantaSecurityException, JMSSecurityException JavaDoc;
164
165     /**
166      * Deletes a permission.
167      *
168      * @param sessionID the session id returned from MantaAuthentication.authenticate method
169      * @param permission the permission to delete
170      * @param principal the principal for whom the permission relates to
171      * @throws PermissionNotFoundException if this permission is not found
172      * @throws MantaSecurityException if an error occured
173      * @throws JMSSecurityException if action is unauthorized for the specific client
174      *
175      */

176     public void deletePermission(SessionID sessionID, MantaPermission permission, MantaPrincipal principal) throws PermissionNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc;
177
178     /**
179      * Creates a new white list entry.
180      *
181      * @param sessionID the session id returned from MantaAuthentication.authenticate method
182      * @param whiteListEntry the white list entry to add
183      * @throws WhiteListEntryAlreadyExistsException if this white list entry already exists
184      * @throws MantaSecurityException if an error occured
185      * @throws JMSSecurityException if action is unauthorized for the specific client
186      *
187      */

188     public void createWhiteListEntry(SessionID sessionID, String JavaDoc whiteListEntry) throws WhiteListEntryAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc;
189
190     /**
191      * Deletes a white list entry.
192      *
193      * @param sessionID the session id returned from MantaAuthentication.authenticate method
194      * @param whiteListEntry the white list entry to delete
195      * @throws WhiteListEntryNotFoundException if this white list entry is not found
196      * @throws MantaSecurityException if an error occured
197      * @throws JMSSecurityException if action is unauthorized for the specific client
198      *
199      */

200     public void deleteWhiteListEntry(SessionID sessionID, String JavaDoc whiteListEntry) throws WhiteListEntryNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc;
201
202     /**
203      * Returns the list of all users.
204      *
205      * @param sessionID the session id returned from MantaAuthentication.authenticate method
206      * @return a list of all users
207      * @throws MantaSecurityException if an error occured
208      * @throws JMSSecurityException if action is unauthorized for the specific client
209      *
210      */

211     public Collection JavaDoc getUsers(SessionID sessionID) throws MantaSecurityException, JMSSecurityException JavaDoc;
212
213     /**
214      * Returns the list of all groups.
215      *
216      * @param sessionID the session id returned from MantaAuthentication.authenticate method
217      * @return a list of all groups
218      * @throws MantaSecurityException if an error occured
219      * @throws JMSSecurityException if action is unauthorized for the specific client
220      *
221      */

222     public Collection JavaDoc getGroups(SessionID sessionID) throws MantaSecurityException, JMSSecurityException JavaDoc;
223
224     /**
225      * Returns the list of all white list entries.
226      *
227      * @param sessionID the session id returned from MantaAuthentication.authenticate method
228      * @return a list of all white list entries
229      * @throws MantaSecurityException if an error occured
230      * @throws JMSSecurityException if action is unauthorized for the specific client
231      *
232      */

233     public Collection JavaDoc getWhiteList(SessionID sessionID) throws MantaSecurityException, JMSSecurityException JavaDoc;
234
235     /**
236      * Returns the JMX object used to communicate with this ACLManagement instance.
237      *
238      * @return the JMX object used to communicate with this ACLManagement instance.
239      *
240      */

241     public Object JavaDoc getManagedObject();
242 }
243
Popular Tags