KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > api > usermgr > UserMgr


1 /*
2  * SecurityManagerIF.java
3  *
4  * Created on May 12, 2003, 1:14 PM
5  */

6
7 package com.raptus.owxv3.api.usermgr;
8
9 import java.util.*;
10
11 /**
12  * Interface to be implemented by user managers
13  * @author jancsi
14  */

15 public interface UserMgr
16 {
17     /**
18      * get a user specified by it's name and password
19      *
20      * @param name the user name
21      * @param password the user password
22      *
23      * @return the User if found, or null if not found
24      */

25     public User getUser(String JavaDoc name, String JavaDoc password);
26     
27     /**
28      * get a user specified by it's name and password
29      *
30      * @param name the user name
31      * @param password the user password
32      *
33      * @return the User if found, or null if not found
34      */

35     public User getUser(String JavaDoc name);
36     
37     
38     /**
39      * Return the number of users in system.
40      *
41      * @return the number of users in system
42      */

43     public int getUsersCount();
44     
45     /**
46      * Return all available users
47      *
48      * @return an iterator with all users in system
49      */

50     public Iterator getUsers();
51     
52     /**
53      * Check if user exists
54      *
55      * @param name the name of the user to be checked
56      *
57      * @return true if an user with this name was found, else return false
58      */

59     public boolean existUser(String JavaDoc name);
60     
61     /**
62      * add a new user
63      *
64      * @param name the name of the user to be added
65      * @param password the password of the user
66      * @param username the login name of the user to be added
67      * @param email the email address of the new user
68      * @param locale the locale of the user
69      * @param addedby the user who added the new user
70      *
71      * @return true if user was successfully added, else returns false
72      */

73     public boolean addUser(String JavaDoc name, String JavaDoc password,String JavaDoc username,String JavaDoc email,String JavaDoc locale, User addedby);
74
75     /**
76      * update a user
77      *
78      * @param name the name of the user to be updaed
79      * @param password the password of the user
80      * @param username the login name of the user to be updated
81      * @param email the email address of the user
82      * @param locale the locale of the user
83      * @param addedby the user who added the user
84      *
85      * @return true if user was successfully updated, else returns false
86      */

87     public boolean updateUser(String JavaDoc name, String JavaDoc password,String JavaDoc username,String JavaDoc email,String JavaDoc locale, User addedby);
88
89     /**
90      * remove a user
91      *
92      * @param user the user to be removed
93      * @param removedby the oser who removed the specified user
94      *
95      * @return true if user was removed successfully else return false
96      */

97     public boolean removeUser(User user,User removedby);
98     
99     /**
100      * Add a new role
101      *
102      * @param role the role to be added
103      * @param description the description of the new role
104      *
105      * @return true if role was successfully added, false if not
106      */

107     public boolean addRole(String JavaDoc role, String JavaDoc description);
108     
109     /**
110      * Update a role
111      *
112      * @param role the role to be updated
113      * @param description the new description
114      *
115      * @return true if role was successfully updated, or false if not
116      */

117     public boolean updateRole(String JavaDoc role, String JavaDoc description);
118     
119     /**
120      * Return a role referenced by it's name
121      *
122      * @param name the name of the role
123      *
124      * @return a Role referenced by its name
125      */

126     public Role getRole(String JavaDoc name);
127     
128     /**
129      * Remove a role
130      *
131      * @param role the role to be removed
132      *
133      * @return true if role was removed, false if not
134      */

135     public boolean removeRole(Role r);
136     
137     /**
138      * Return the roles available in system
139      *
140      * @return an Iterator with the available roles
141      */

142     public Iterator getAllRolesAsString();
143     
144     /**
145      * Return the roles available in system, as Role objects
146      *
147      * @return an Iterator with the available roles, as Role objects
148      */

149     public Iterator getAllRoles();
150     
151     /**
152      * return roles asociated to specified user, as Role objects
153      *
154      * @param u the user for who we require the roles
155      *
156      * @return all roles associated to specified user, as Role objects
157      */

158     public Iterator getRolesForUser(User u);
159     
160     /**
161      * return roles asociated to specified user, as String objects
162      *
163      * @param u the user for who we require the roles
164      *
165      * @return all roles associated to specified user, as String objects
166      */

167     public Iterator getRolesAsStringForUser(User u);
168
169    /**
170      * Set the roles for the specified user
171      *
172      * @param u the user for who we're setting the roles
173      * @param roles the names of the roles
174      */

175     public void setRolesForUser(User u, String JavaDoc[] roles);
176
177    /**
178      * Set the roles for the specified user
179      *
180      * @param u the user for who we're setting the roles
181      * @param roles the names of the roles
182      */

183     public void setRolesForUser(User u, List roles);
184
185 }
186
187
Popular Tags