FileDocCategorySizeDatePackage
RoleReference.javaAPI DocGlassfish v2 API4612Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

RoleReference

public class RoleReference extends EnvironmentProperty implements com.sun.enterprise.deployment.web.SecurityRoleReference
Special kind of environment property that encapsulates the primitive roles as defined by the bean developer. The name of a primitive role will appear in the bean code, the value will be mapped to the name of a Role chosen by the application assembler which is referenced by the EjbBundle being assembled.
author
Danny Coward

Fields Summary
Constructors Summary
public RoleReference()
Default constructor.

    
public RoleReference(String name, String description)
Construct a role reference from the given name and description.

	super(name, "", description);
    
public RoleReference(EnvironmentProperty environmentProperty)
Construct the role reference with the same name and rolename the same as the environment property value.

param
the environment property instance.

	super(environmentProperty.getName(), 
		environmentProperty.getDescription(), "");
	this.setValue(environmentProperty.getValue());
    
Methods Summary
public com.sun.enterprise.deployment.RolegetRole()
Return the role object from this descriptor.

return
the role.

	return new Role(super.getValue());
    
public java.lang.StringgetRolename()
Return the coded name.

return
the role name used in the bean code.

	return this.getName();
    
public com.sun.enterprise.deployment.web.SecurityRolegetSecurityRoleLink()
Return the rolename.

return
the role name.

	return new SecurityRoleDescriptor(super.getValue(), "");
    
public voidprint(java.lang.StringBuffer toStringBuffer)
Returns a formatted version of this object as a String.

	toStringBuffer.append("Role-Ref-Env-Prop: ").append(super.getName()).append("@").append( 
	    this.getRole()).append("@").append(super.getDescription());
    
voidsetRole(com.sun.enterprise.deployment.Role role)
Set the value for the reference.

param
the role

	super.setValue(role.getName());
    
public voidsetRolename(java.lang.String rolename)
Sets the coded name.

param
the role name used in the bean code.

	this.setName(rolename);
    
public voidsetSecurityRoleLink(com.sun.enterprise.deployment.web.SecurityRole securityRole)
Sets the rolename.

param
the rolename.

	super.setValue(securityRole.getName());