FileDocCategorySizeDatePackage
SecurityConstraintDecorator.javaAPI DocGlassfish v2 API3755Fri May 04 22:36:04 BST 2007com.sun.enterprise.web.deploy

SecurityConstraintDecorator

public class SecurityConstraintDecorator extends org.apache.catalina.deploy.SecurityConstraint
Decorator of class org.apache.catalina.deploy.SecurityConstraint
author
Jean-Francois Arcand

Fields Summary
private com.sun.enterprise.deployment.web.SecurityConstraint
securityConstraint
Constructors Summary
public SecurityConstraintDecorator(com.sun.enterprise.deployment.web.SecurityConstraint securityConstraint, com.sun.enterprise.web.WebModule webModule)

        this.securityConstraint = securityConstraint;
        
        if (securityConstraint.getAuthorizationConstraint() != null){
            setAuthConstraint(true);
            Enumeration enumeration = securityConstraint
                            .getAuthorizationConstraint().getSecurityRoles();

            SecurityRole securityRole;
            while (enumeration.hasMoreElements()){
                securityRole = (SecurityRole)enumeration.nextElement();
                super.addAuthRole(securityRole.getName());
                if ( !securityRole.getName().equals("*")){
                    webModule.addSecurityRole(securityRole.getName());
                }
            }
            setDisplayName(securityConstraint.getAuthorizationConstraint().getName());
        }
 
        if (securityConstraint.getUserDataConstraint() != null){
            setUserConstraint(securityConstraint.getUserDataConstraint()
                                                    .getTransportGuarantee());
        }
        
    
Methods Summary