KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > security > plugins > SecurityManagerMBean


1 /*
2 * JBoss, the OpenSource J2EE webOS
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */

7 package org.jboss.security.plugins;
8
9 import java.security.Principal JavaDoc;
10 import java.util.Set JavaDoc;
11
12 /** An MBean interface that unifies the AuthenticationManager and RealmMapping
13  * security interfaces implemented by a security manager for a given domain
14  * and provides access to this functionality across all domains by including
15  * the security domain name as a method argument.
16  *
17  * @author Scott.Stark@jboss.org
18  * @version $Revision: 1.3.6.2 $
19  */

20 public interface SecurityManagerMBean
21 {
22
23    /** The isValid method is invoked to see if a user identity and associated
24     credentials as known in the operational environment are valid proof of the
25     user identity.
26     @param securityDomain - the name of the security to use
27     @param principal - the user identity in the operation environment
28     @param credential - the proof of user identity as known in the
29     operation environment
30     @return true if the principal, credential pair is valid, false otherwise.
31    */

32    public boolean isValid(String JavaDoc securityDomain, Principal JavaDoc principal, Object JavaDoc credential);
33
34     /** Map from the operational environment Principal to the application
35      domain principal. This is used by the EJBContext.getCallerPrincipal implentation
36      to map from the authenticated principal to a principal in the application
37      domain.
38     @param principal - the caller principal as known in the operation environment.
39     @return the principal
40     */

41     public Principal JavaDoc getPrincipal(String JavaDoc securityDomain, Principal JavaDoc principal);
42
43     /** Validates the application domain roles to which the operational
44     environment Principal belongs. This may first authenticate the principal
45     as some security manager impls require a preceeding isValid call.
46      @param securityDomain - the name of the security to use
47      @param principal - the user identity in the operation environment
48      @param credential - the proof of user identity as known in the
49     @param roles - Set<Principal> for the application domain roles that the
50      principal is to be validated against.
51     @return true if the principal has at least one of the roles in the roles set,
52         false otherwise.
53      */

54     public boolean doesUserHaveRole(String JavaDoc securityDomain, Principal JavaDoc principal,
55        Object JavaDoc credential, Set JavaDoc roles);
56
57     /** Return the set of domain roles the principal has been assigned.
58      This may first authenticate the principal as some security manager impls
59      require a preceeding isValid call.
60      @param securityDomain - the name of the security to use
61      @param principal - the user identity in the operation environment
62      @param credential - the proof of user identity as known in the
63     @return The Set<Principal> for the application domain roles that the
64      principal has been assigned.
65      */

66     public Set JavaDoc getUserRoles(String JavaDoc securityDomain, Principal JavaDoc principal,
67        Object JavaDoc credential);
68 }
69
Popular Tags