FileDocCategorySizeDatePackage
RoleMapperFactory.javaAPI DocGlassfish v2 API3967Fri May 04 22:35:24 BST 2007com.sun.enterprise.security.acl

RoleMapperFactory

public class RoleMapperFactory extends Object implements com.sun.enterprise.deployment.interfaces.SecurityRoleMapperFactory
author
Jerome Dochez

Fields Summary
private static Map
CONTEXT_TO_APPNAME
Constructors Summary
public RoleMapperFactory()
Creates a new instance of RoleMapperFactory

           
      
    
Methods Summary
public java.lang.StringgetAppNameForContext(java.lang.String contextId)

        return (String)CONTEXT_TO_APPNAME.get(contextId);
    
public com.sun.enterprise.deployment.interfaces.SecurityRoleMappergetRoleMapper(java.lang.String appName)
Returns a RoleMapper corresponding to the AppName.

param
The Application Name of this RoleMapper.

        // if the appName is not appname but contextid for
        // web apps then get the appname
        String contextId = appName;
        String appname = getAppNameForContext(appName);
        SecurityRoleMapper srm = null;
        if(appname != null)
            srm = RoleMapper.getRoleMapper(appname);
        if(srm == null){
            srm = RoleMapper.getRoleMapper(contextId);
        }
        return srm;
    
public voidremoveAppNameForContext(java.lang.String contextId)

        CONTEXT_TO_APPNAME.remove(contextId);
    
public voidremoveRoleMapper(java.lang.String appName)
remove the RoleMapping associated with this application

param
the application name for this RoleMapper

        RoleMapper.removeRoleMapper(appName);
    
public voidsetAppNameForContext(java.lang.String appName, java.lang.String contextId)

        CONTEXT_TO_APPNAME.put(contextId, appName); 
    
public voidsetRoleMapper(java.lang.String appName, com.sun.enterprise.deployment.interfaces.SecurityRoleMapper rmap)
Sets a new RoleMapper for a particular Application

param
the application name
param
the new role mapper

        RoleMapper.setRoleMapper(appName, rmap);