KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > explorer > core > role > api > RoleProvider


1 /*====================================================================
2
3 Objectweb Explorer Framework
4 Copyright (C) 2000-2005 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Moroy, Philippe Merle.
23 Contributor(s): ______________________________________.
24
25 ====================================================================
26 $Id: RoleProvider.java,v 1.2 2005/07/06 15:36:00 moroy Exp $
27 ====================================================================*/

28
29 package org.objectweb.util.explorer.core.role.api;
30
31 /**
32  * This interface resolves the mappings between role ID and its associated Role object.
33  *
34  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jérôme Moroy</a>,
35  * <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>.
36  *
37  * @version 0.1
38  */

39 public interface RoleProvider {
40
41     /** The name of the fractal interface reference. */
42     public static String JavaDoc ROLE_PROVIDER = "role-provider";
43     /** Represent the default user (when no user is defined). */
44     public static final String JavaDoc DEFAULT_ROLE = "_Default_Role_";
45     
46     /**
47      * Provides the role identified by the given id param (or null if no mapping is defined).
48      * @param roleId The ID of the role.
49      * @return The associated Role.
50      */

51     public Role getRole(String JavaDoc roleId);
52     
53     /**
54      * Provides an array of roles identified by the given array of IDs (or and empty array if no mappings are defined).
55      * @param id The IDs of the roles.
56      * @return The associated Roles.
57      */

58     public Role[] getRoles(String JavaDoc[] roleIds);
59
60     /**
61      * Provides an array of roles ids corresponding to the given array of Roles.
62      * @param roles The array of roles
63      * @return The corresponding array of role ids
64      */

65     public String JavaDoc[] getRoleIds(Role[] roles);
66     
67     /**
68      * Provides the inherited roles of the given role IDs.
69      * If no inherited role is defined, an empty array is returned.
70      * @param roleIds An array of roles ID.
71      * @return An array containing the inherited roles of the given roles.
72      */

73     public String JavaDoc[] getInheritedRoleIds(String JavaDoc[] roleIds);
74
75     /**
76      * Provides the list of all defined roles.
77      * Equivalent to <code>RoleProvider.getRoleList(false)</code>.
78      * @see RoleProvider#getRoleList(boolean)
79      * @return The list of defines roles.
80      */

81     public String JavaDoc[] getRoleList();
82     
83     /**
84      * Provides the list of all defined roles, sorted in alphabetic order.
85      * Equivalent to <code>RoleProvider.getRoleList(false, false)</code>.
86      * @see RoleProvider#getRoleList(boolean, boolean)
87      * @return The list of defined roles.
88      */

89     public String JavaDoc[] getRoleList(boolean alphabeticOrder);
90     
91     /**
92      * Provides the list of all defined roles (expected those which are considered as abstracts),
93      * sorted in alphabetic order.
94      * @return The list of defined roles.
95      */

96     public String JavaDoc[] getRoleList(boolean alphabeticOrder, boolean excludedAbstractRoles);
97         
98     /**
99      * Provides the default role.
100      * @return The default role.
101      */

102     public Role getDefaultRole();
103     
104 }
105
Popular Tags