KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > commonimpl > user > UserManagementStrategy


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.commonimpl.user;
17
18 import org.outerj.daisy.repository.user.Roles;
19 import org.outerj.daisy.repository.user.Users;
20 import org.outerj.daisy.repository.user.AuthenticationSchemeInfos;
21 import org.outerj.daisy.repository.commonimpl.AuthenticatedUser;
22 import org.outerj.daisy.repository.RepositoryException;
23
24 /**
25  * <p>Allows to customise the behaviour of the abstract implementation classes of the
26  * repository User Management API.
27  *
28  * <p>For (important) general information about this and other strategy interfaces, see also
29  * {@link org.outerj.daisy.repository.commonimpl.DocumentStrategy}.
30  */

31 public interface UserManagementStrategy {
32
33     /**
34      * returns all the Users in the system
35      */

36     Users loadUsers(AuthenticatedUser requestingUser) throws RepositoryException;
37
38     /**
39      * Returns the IDs of all users in the system.
40      */

41     long[] getUserIds(AuthenticatedUser requestingUser) throws RepositoryException;
42
43     /**
44      * returns all the roles in the system
45      */

46     Roles loadRoles(AuthenticatedUser requestingUser) throws RepositoryException;
47
48     /**
49      * deletes the user with given userID from the system
50      * @param userId the data store id of the User to delete
51      */

52     void deleteUser(long userId, AuthenticatedUser requestingUser) throws RepositoryException;
53
54     /**
55      * deletes a role from the system
56      * @param roleId the data store id of the role to delete
57      */

58     void deleteRole(long roleId, AuthenticatedUser requestingUser) throws RepositoryException;
59
60     /**
61      * @param login login of the user object
62      * @param requestingUser the authenticated user that requests this object
63      * @return
64      */

65     UserImpl getUser(String JavaDoc login, AuthenticatedUser requestingUser) throws RepositoryException;
66
67     /**
68      * @param roleName the name of the role you want to obtain
69      * @param requestingUser the authenticated user that requests this object
70      * @return the Role object with the specified roleName
71      */

72     RoleImpl getRole(String JavaDoc roleName, AuthenticatedUser requestingUser) throws RepositoryException;
73
74     /**
75      * stores the specified UserImpl to the data store
76      * @param user the UserImpl object to persist
77      */

78     void store(UserImpl user) throws RepositoryException;
79     
80     /**
81      * stores the specified RoleImpl to the data store
82      * @param role the RoleImpl object to persist
83      */

84     void store(RoleImpl role) throws RepositoryException;
85
86     /**
87      * @param userId the data stoe id of the user object to fetch
88      * @param user the authenticated user that requests this object
89      * @return
90      */

91     UserImpl getUser(long userId, AuthenticatedUser user) throws RepositoryException;
92
93     /**
94      * @param roleId the data store id of the role object to fetch
95      * @param user the authenticated user that requests this object
96      * @return
97      */

98     RoleImpl getRole(long roleId, AuthenticatedUser user) throws RepositoryException;
99
100     UsersImpl getUsersByEmail(String JavaDoc email, AuthenticatedUser requestingUser) throws RepositoryException;
101
102     AuthenticationSchemeInfos getAuthenticationSchemes(AuthenticatedUser requestingUser) throws RepositoryException;
103 }
104
Popular Tags