KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.jboss.portal.core.model.Role;
12
13 import java.util.Set JavaDoc;
14 import java.util.List JavaDoc;
15
16 /**
17  * @author <a HREF="mailto:julien@jboss.org">Julien Viet </a>
18  * @author <a HREF="mailto:theute@jboss.org">Thomas Heute </a>
19  * @author Roy Russo : roy at jboss dot org
20  * @version $Revision: 1.2 $
21  */

22 public interface RoleModule
23 {
24    /**
25     * Retrieves a role by its name
26     *
27     * @param name the role name
28     * @return the role
29     */

30    Role findRoleByName(String JavaDoc name) throws IllegalArgumentException JavaDoc, ModuleException;
31
32    Set JavaDoc findRolesByNames(String JavaDoc[] names) throws IllegalArgumentException JavaDoc, ModuleException;
33
34    /**
35     * Retrieves a role by its displayname
36     *
37     * @param displayname the role display name
38     * @return the role
39     */

40    Role findRoleByDisplayName(String JavaDoc displayName) throws IllegalArgumentException JavaDoc, ModuleException;
41
42    /**
43     * Retrieves a role by its numerical id.
44     *
45     * @param id the role id
46     * @return the role
47     */

48    Role findRoleByID(Integer JavaDoc id) throws IllegalArgumentException JavaDoc, ModuleException;
49
50    /**
51     * Create a new role with the specified name.
52     *
53     * @param name the role name
54     * @param displayName the role display name
55     * @return the role
56     */

57    Role createRole(String JavaDoc name, String JavaDoc displayName) throws IllegalArgumentException JavaDoc, ModuleException;
58
59    /**
60     * Remove a role.
61     *
62     * @param id the role id
63     */

64    void removeRole(Integer JavaDoc id) throws IllegalArgumentException JavaDoc, ModuleException;
65
66    /**
67     * Returns the number of roles.
68     *
69     * @return the number of roles
70     */

71    int getRolesCount() throws ModuleException;
72
73    /**
74     * Get all the roles
75     *
76     * @return the roles
77     */

78    Set JavaDoc findRoles() throws ModuleException;
79
80    /**
81     * Returns role members based on rolename
82     *
83     * @param roleName
84     * @param offset
85     * @param limit
86     * @return
87     * @throws ModuleException
88     */

89    Set JavaDoc findRoleMembers(String JavaDoc roleName, int offset, int limit, String JavaDoc userNameFilter) throws ModuleException;
90 }
Popular Tags