FileDocCategorySizeDatePackage
AuthorizationConstraintImpl.javaAPI DocGlassfish v2 API4482Fri May 04 22:31:20 BST 2007com.sun.enterprise.deployment

AuthorizationConstraintImpl

public class AuthorizationConstraintImpl extends Descriptor implements com.sun.enterprise.deployment.web.AuthorizationConstraint
This descriptor represents an authorization contraint on a security constraint in a web application.
author
Danny Coward

Fields Summary
private Set
securityRoles
Constructors Summary
public AuthorizationConstraintImpl()
Default constructor that creates an AuthorizationConstraint with no roles.

    
public AuthorizationConstraintImpl(AuthorizationConstraintImpl other)
Copy constructor.

	this.securityRoles = new HashSet(other.getSecurityRoleSet());
    
Methods Summary
public voidaddSecurityRole(com.sun.enterprise.deployment.web.SecurityRole securityRole)
Adds a role to the authorization constraint.

param
the role to be added.

	this.getSecurityRoleSet().add(securityRole);
    
public voidaddSecurityRole(java.lang.String roleName)
Adds a role to the authorization constraint

param
the role name to be added

        SecurityRoleDescriptor sr = new SecurityRoleDescriptor();
        sr.setName(roleName);
        addSecurityRole(sr);
    
private java.util.SetgetSecurityRoleSet()
Return the set of roles.

	if (this.securityRoles == null) {
	    this.securityRoles = new HashSet();
	}
	return this.securityRoles;
    
public java.util.EnumerationgetSecurityRoles()
Return the security roles involved in this constraint. The enumeration is empty if there are none.

return
the enumeration of security roles in this constraint.

	if (this.securityRoles == null) {
	    this.securityRoles = new HashSet();
	}
	return (new Vector(this.getSecurityRoleSet())).elements();
    
public voidprint(java.lang.StringBuffer toStringBuffer)
Prints a formatted representation of this object.

	toStringBuffer.append("AuthorizationConstraint ");
	super.print(toStringBuffer);
	toStringBuffer.append(" securityRoles ").append(this.securityRoles);
    
public voidremoveSecurityRole(com.sun.enterprise.deployment.web.SecurityRole securityRole)
Removes the given role from the autrhorization constraint.

param
the role to be removed.

	this.getSecurityRoleSet().remove(securityRole);