org.apache.lenya.ac
Class Identity

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.ac.Identity
All Implemented Interfaces:
java.io.Serializable, org.apache.avalon.framework.logger.LogEnabled, Accreditable, Identifiable

public class Identity
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements Identifiable, java.io.Serializable

Identity object. Used to store the authenticated accreditables in the session.

See Also:
Serialized Form

Constructor Summary
Identity(org.apache.avalon.framework.logger.Logger logger)
          Ctor.
 
Method Summary
 void addIdentifiable(Identifiable identifiable)
          Adds a new identifiable to this identity.
 boolean belongsTo(AccreditableManager manager)
          Checks if this identity belongs to a certain accreditable manager.
 boolean contains(Identifiable identifiable)
          Checks if this identity contains a certain identifiable.
 Accreditable[] getAccreditables()
          Returns the set of accreditables of this accreditable.
 Identifiable[] getIdentifiables()
          Returns the identifiables of this identity.
static Identity getIdentity(org.apache.cocoon.environment.Session session)
          Fetches the identity from a session.
 Machine getMachine()
          Returns the machine of this identity.
 User getUser()
          Returns the user of this identity.
 void initialize()
          Initializes this identity.
 void removeIdentifiable(Identifiable identifiable)
          Removes a certain identifiable from the idenity.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Identity

public Identity(org.apache.avalon.framework.logger.Logger logger)
Ctor.

Parameters:
logger - The logger.
Method Detail

initialize

public void initialize()
Initializes this identity.


getIdentifiables

public Identifiable[] getIdentifiables()
Returns the identifiables of this identity.

Returns:
An array of identifiables.

addIdentifiable

public void addIdentifiable(Identifiable identifiable)
Adds a new identifiable to this identity.

Parameters:
identifiable - The identifiable to add.

getAccreditables

public Accreditable[] getAccreditables()
Description copied from interface: Accreditable
Returns the set of accreditables of this accreditable. The set contains the accreditable itself and all collections it belongs to.

Specified by:
getAccreditables in interface Accreditable
Returns:
An array of accreditables.
See Also:
Accreditable.getAccreditables()

toString

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

belongsTo

public boolean belongsTo(AccreditableManager manager)
                  throws AccessControlException
Checks if this identity belongs to a certain accreditable manager.

Parameters:
manager - The accreditable manager to check for.
Returns:
A boolean value.
Throws:
AccessControlException - if an error occurs

getUser

public User getUser()
Returns the user of this identity.

Returns:
A user.

getMachine

public Machine getMachine()
Returns the machine of this identity.

Returns:
A machine.

contains

public boolean contains(Identifiable identifiable)
Checks if this identity contains a certain identifiable.

Parameters:
identifiable - The identifiable to look for.
Returns:
A boolean value.

getIdentity

public static Identity getIdentity(org.apache.cocoon.environment.Session session)
Fetches the identity from a session.

Parameters:
session - The session.
Returns:
An identity.

removeIdentifiable

public void removeIdentifiable(Identifiable identifiable)
Removes a certain identifiable from the idenity.

Parameters:
identifiable - An identifiable.


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.