KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > core > modules > UserModule


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.core.modules;
10
11 import java.util.Set JavaDoc;
12
13 import org.jboss.portal.core.model.User;
14
15 /**
16  * @author <a HREF="mailto:julien@jboss.org">Julien Viet </a>
17  * @version $Revision: 1.2 $
18  */

19 public interface UserModule
20 {
21    /**
22     * Retrieve a user by its name.
23     *
24     * @param userName the user name
25     * @return the user
26     */

27    User findUserByUserName(String JavaDoc userName) throws IllegalArgumentException JavaDoc, ModuleException;
28
29    /**
30     * Retrieve a user by its numerical id.
31     *
32     * @param id the user id
33     * @return the user
34     */

35    User findUserByID(Integer JavaDoc id) throws IllegalArgumentException JavaDoc, ModuleException;
36
37    /**
38     * Creates a new user with the specified name.
39     *
40     * @param name the user name
41     * @return the user
42     */

43    User createUser(String JavaDoc name, String JavaDoc password, String JavaDoc realEmail) throws IllegalArgumentException JavaDoc, ModuleException;
44
45    /**
46     * Remove a user.
47     *
48     * @param id the user id
49     */

50    void removeUser(Integer JavaDoc id) throws IllegalArgumentException JavaDoc, ModuleException;
51
52    /**
53     * Get a range of users.
54     *
55     * @param offset the offset of the first result to retrieve
56     * @param limit the maximum number of users to retrieve
57     * @return the user set
58     */

59    Set JavaDoc findUsers(int offset, int limit) throws IllegalArgumentException JavaDoc, ModuleException;
60
61    Set JavaDoc findUsersFilteredByUsername(String JavaDoc filter, int offset, int limit) throws ModuleException;
62
63    /**
64     * Returns the number of users.
65     *
66     * @return the number of users
67     */

68    int getUserCount() throws IllegalArgumentException JavaDoc, ModuleException;
69 }
Popular Tags