KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > interfaces > SecurityRoleMapper


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.deployment.interfaces;
25
26 import java.util.Iterator JavaDoc;
27 import java.util.Enumeration JavaDoc;
28 import java.security.Principal JavaDoc;
29 import java.util.Map JavaDoc;
30 import com.sun.enterprise.deployment.Role;
31
32 /**
33  * This interface defines the protocol used by the DOL to access the role
34  * mapping information of a J2EE application. This class is implemented by
35  * other modules and their instanciation is done through the
36  * SecurityRoleMapperFactory class.
37  *
38  * @author Jerome Dochez
39  */

40 public interface SecurityRoleMapper {
41     
42     /**
43      * Set the role mapper application name
44      * @param the app name
45      */

46     public void setName(String JavaDoc name);
47     
48     /**
49      * @return the role mapper application name
50      */

51     public String JavaDoc getName();
52     
53     /**
54      * @return an iterator on all the assigned roles
55      */

56     public Iterator JavaDoc getRoles();
57     
58     /**
59      * @rturns an enumeration of Principals assigned to the given role
60      * @param The Role to which the principals are assigned to.
61      */

62     public Enumeration JavaDoc getUsersAssignedTo(Role r);
63     
64     
65     /**
66      * Returns an enumeration of Groups assigned to the given role
67      * @param The Role to which the groups are assigned to.
68      */

69     public Enumeration JavaDoc getGroupsAssignedTo(Role r);
70     
71     /**
72      * Assigns a Principal to the specified role.
73      * @param The principal that needs to be assigned to the role.
74      * @param The Role the principal is being assigned to.
75      */

76     public void assignRole(Principal JavaDoc p, Role r);
77     
78     /**
79      * Remove the given role-principal mapping
80      * @param role, Role object
81      * @param principal, the principal
82      */

83     public void unassignPrincipalFromRole(Role role, Principal JavaDoc principal);
84     
85     /**
86      * Remove all the role mapping information for this role
87      * @param role, the role object
88      */

89     public void unassignRole(Role role);
90     /*
91      * @Map a map of roles to the corresponding subjects
92      */

93     public Map JavaDoc getRoleToSubjectMapping();
94 }
95
Popular Tags