org.apache.lenya.ac.impl
Class Credential

java.lang.Object
  extended by org.apache.lenya.ac.impl.Credential

public class Credential
extends java.lang.Object

A credential assigns a set of Roles to an Accreditable.


Constructor Summary
Credential(Accreditable accreditable)
          Creates a new credential object.
 
Method Summary
 void addRole(Role role)
          Adds a role to this credential.
 boolean contains(Role role)
          Returns if a role is contained.
 Accreditable getAccreditable()
          Returns the accreditable of this credential.
 Role[] getRoles()
          Returns all roles of this credential.
 boolean isEmpty()
          Returns if the credential is empty (contains no roles).
 void removeRole(Role role)
          Removes a role from this credential.
protected  void setAccreditable(Accreditable accreditable)
          Sets the accreditable for this credential.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Credential

public Credential(Accreditable accreditable)
Creates a new credential object.

Parameters:
accreditable - The accreditable.
Method Detail

setAccreditable

protected void setAccreditable(Accreditable accreditable)
Sets the accreditable for this credential.

Parameters:
accreditable - The accreditable.

getRoles

public Role[] getRoles()
Returns all roles of this credential.

Returns:
An array of roles.

addRole

public void addRole(Role role)
Adds a role to this credential.

Parameters:
role - The role to add.

removeRole

public void removeRole(Role role)
Removes a role from this credential.

Parameters:
role - The role to remove.

getAccreditable

public Accreditable getAccreditable()
Returns the accreditable of this credential.

Returns:
An accreditable.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

contains

public boolean contains(Role role)
Returns if a role is contained.

Parameters:
role - A role.
Returns:
A boolean value.

isEmpty

public boolean isEmpty()
Returns if the credential is empty (contains no roles).

Returns:
A boolean value.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.