com.opensymphony.user
Class Entity

java.lang.Object
  extended bycom.opensymphony.user.Entity
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Group, User

public abstract class Entity
extends java.lang.Object
implements java.io.Serializable

Superclass for User and Group.

Methods common to both User and Group are defined here.

When an entity is modified the store() method has to be called to force the provider to persist changes. This is a convenience for Providers and they may choose to write data before then.

Version:
$Revision: 1.1.1.1 $
Author:
Joe Walnes
See Also:
Serialized Form

Nested Class Summary
 class Entity.Accessor
          This inner class can be passed by Entity to a Accessor to allow private fields to be accessed from an external object.
 
Field Summary
protected  Entity.Accessor accessor
           
protected  boolean mutable
          Whether this entity is mutable (i.e.
protected  java.lang.String name
          Name of entity (unique).
 
Constructor Summary
protected Entity(java.lang.String name, UserManager.Accessor managerAccessor)
          Constructor to be called by User or Group.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare name.
 AccessProvider getAccessProvider()
          Retrieve pluggable AccessProvider for this entity.
 CredentialsProvider getCredentialsProvider()
          Retrieve pluggable CredentialsProvider for this entity.
 java.lang.String getName()
          Name (unique identifier) of entity.
 ProfileProvider getProfileProvider()
          Retrieve pluggable ProfileProvider for this entity.
 com.opensymphony.module.propertyset.PropertySet getPropertySet()
          Extra properties associated with entity.
 UserManager getUserManager()
          Retrieve underlying UserManager that this User is handled by.
 int hashCode()
          Hashcode of name.
 boolean isMutable()
          Determine if entity is mutable.
abstract  void remove()
          Remove this entity from existence.
 void store()
          Force update to underlying data-stores.
 java.lang.String toString()
          String representation returns name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

accessor

protected Entity.Accessor accessor

name

protected java.lang.String name
Name of entity (unique).


mutable

protected boolean mutable
Whether this entity is mutable (i.e. can be modifed).

Constructor Detail

Entity

protected Entity(java.lang.String name,
                 UserManager.Accessor managerAccessor)
Constructor to be called by User or Group. Should pass across name of Entity and UserManager.Accessor for priveleged access to the UserManager.

Method Detail

getCredentialsProvider

public CredentialsProvider getCredentialsProvider()
Retrieve pluggable CredentialsProvider for this entity.


getName

public java.lang.String getName()
Name (unique identifier) of entity. This cannot be changed once the entity has been created.


getProfileProvider

public ProfileProvider getProfileProvider()
Retrieve pluggable ProfileProvider for this entity.


getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet()
Extra properties associated with entity. This is managed by ProfileProvider.


remove

public abstract void remove()
                     throws ImmutableException
Remove this entity from existence. If a provider does not allow removal, ImmutableException shall be thrown.

Throws:
ImmutableException

getAccessProvider

public AccessProvider getAccessProvider()
Retrieve pluggable AccessProvider for this entity.


isMutable

public boolean isMutable()
Determine if entity is mutable. If entity is read-only, false is returned.


getUserManager

public UserManager getUserManager()
Retrieve underlying UserManager that this User is handled by.


equals

public boolean equals(java.lang.Object obj)
Compare name.


hashCode

public int hashCode()
Hashcode of name.


store

public void store()
           throws ImmutableException
Force update to underlying data-stores. This allows providers that do not update persistent data on the fly to store changes. If any of the providers are immutable and fields that cannot be updated have changed, ImmutableException shall be thrown.

Throws:
ImmutableException

toString

public java.lang.String toString()
String representation returns name.


See www.opensymphony.com for more information.