KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > james > remotemanager > UserManager


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

17
18 package org.apache.james.remotemanager;
19
20 import java.util.ArrayList JavaDoc;
21 import java.rmi.Remote JavaDoc;
22 import java.rmi.RemoteException JavaDoc;
23
24
25 /**
26  * This interface specified all method which are possible to
27  * admin the Users.
28  *
29  */

30 public interface UserManager extends Remote JavaDoc {
31
32
33     /**
34      * Return the names of all available repositories.
35      *
36      * @return List of all repository names.
37      * @exception RemoteException
38      */

39     ArrayList JavaDoc getRepositoryNames()
40             throws RemoteException JavaDoc;
41
42     /**
43      * Set a repository from the list
44      *
45      * @param repository name of the new repository
46      * @return true if set repository was successful otherwise false.
47      * @exception RemoteException
48      */

49     boolean setRepository(String JavaDoc repository)
50             throws RemoteException JavaDoc;
51
52     /**
53      * add a new user.
54      *
55      * @param username users name
56      * @param password users password
57      * @return true if user added successful otherwise false.
58      * @exception RemoteException
59      */

60     boolean addUser(String JavaDoc username,
61                     String JavaDoc password)
62             throws RemoteException JavaDoc;
63     /**
64      * delete a user.
65      *
66      * @param username users name
67      * @return true if user deleted successful otherwise false
68      * @exception RemoteException
69      */

70     boolean deleteUser(String JavaDoc username)
71             throws RemoteException JavaDoc;
72     /**
73      * verify a user.
74      *
75      * @param username users name
76      * @return true if user exists otherwise false
77      * @exception RemoteException
78      */

79     boolean verifyUser(String JavaDoc username)
80             throws RemoteException JavaDoc;
81     /**
82      * list all users names.
83      *
84      * @return list of all users
85      * @exception RemoteException
86      */

87     ArrayList JavaDoc getUserList()
88             throws RemoteException JavaDoc;
89     /**
90      * count all users.
91      *
92      * @return
93      * @exception RemoteException
94      */

95     int getCountUsers()
96             throws RemoteException JavaDoc;
97
98     /**
99      * reset password for a user.
100      *
101      * @param username users name.
102      * @param password new password
103      * @return true if reset was successful otherwise false.
104      * @exception RemoteException
105      */

106     boolean setPassword(String JavaDoc username,
107                         String JavaDoc password)
108             throws RemoteException JavaDoc;
109
110     /**
111      * set alias for users.
112      *
113      * @param username users name.
114      * @param alias users alias
115      * @return true if set alias was successful otherwise false.
116      * @exception RemoteException
117      */

118     boolean setAlias(String JavaDoc username,
119                      String JavaDoc alias)
120             throws RemoteException JavaDoc;
121     /**
122      * unset alias.
123      *
124      * @param username users name
125      * @return true if unset alias was successful otherwise false
126      * @exception RemoteException
127      */

128     boolean unsetAlias(String JavaDoc username)
129             throws RemoteException JavaDoc;
130     /**
131      * check if alias is set for this user.
132      *
133      * @param username users name
134      * @return if alias is set you will get the alias otherwise null
135      * @exception RemoteException
136      */

137     String JavaDoc checkAlias(String JavaDoc username)
138             throws RemoteException JavaDoc;
139
140     /**
141      * set forward mailaddress for a user.
142      *
143      * @param username users name.
144      * @param forward forward mailaddress
145      * @return true if set forward was successful otherwise false
146      * @exception RemoteException
147      */

148     boolean setForward(String JavaDoc username,
149                        String JavaDoc forward)
150             throws RemoteException JavaDoc;
151     /**
152      * unset forward to mailaddress.
153      *
154      * @param username users name
155      * @return true if unset forward was successful otherwise false.
156      * @exception RemoteException
157      */

158     boolean unsetForward(String JavaDoc username)
159             throws RemoteException JavaDoc;
160     /**
161      * check if forward is set.
162      *
163      * @param username users name
164      * @return if forward is set you will get the forwarding mailaddress
165      * otherweise null
166      * @exception RemoteException
167      */

168     String JavaDoc checkForward(String JavaDoc username)
169             throws RemoteException JavaDoc;
170
171 }
172
Popular Tags