org.apache.turbine.om.security
Interface User

All Superinterfaces:
java.util.EventListener, javax.servlet.http.HttpSessionBindingListener, SecurityEntity, java.io.Serializable
All Known Implementing Classes:
LDAPUser, TorqueUser

public interface User
extends javax.servlet.http.HttpSessionBindingListener, java.io.Serializable, SecurityEntity

This interface represents functionality that all users of the Turbine system require.

Version:
$Id: User.java 534527 2007-05-02 16:10:59Z tv $
Author:
Frank Y. Kim, John D. McNally, Jon S. Stevens, Craig D. Berry, Henning P. Schmiedehausen

Field Summary
static java.lang.String ACCESS_COUNTER
          The 'perm storage' key name for the access counter.
static java.lang.String CONFIRM_DATA
          This is the value that is stored in the database for confirmed users
static java.lang.String CONFIRM_VALUE
          The 'perm storage' key for the confirm_value field.
static java.lang.String EMAIL
          The 'perm storage' key for the email field.
static java.lang.String FIRST_NAME
          The 'perm storage' key name for the first name.
static java.lang.String HAS_LOGGED_IN
          The 'temp storage' key name for the 'has logged in' flag
static java.lang.String LAST_LOGIN
          The 'perm storage' key name for the last_login field.
static java.lang.String LAST_NAME
          The 'perm storage' key name for the last name.
static java.lang.String PASSWORD
          The 'perm storage' key name for the password field.
static java.lang.String SESSION_ACCESS_COUNTER
          The 'temp storage' key name for the session access counter
static java.lang.String SESSION_KEY
          The session key for the User object.
static java.lang.String USERNAME
          The 'perm storage' key name for the username field.
 
Method Summary
 int getAccessCounter()
          Gets the access counter for a user from perm storage.
 int getAccessCounterForSession()
          Gets the access counter for a user during a session.
 java.lang.String getConfirmed()
          Gets the confirmation value.
 java.util.Date getCreateDate()
          Gets the create date for this User.
 java.lang.String getEmail()
          Returns the email address for this user.
 java.lang.String getFirstName()
          Returns the first name for this user.
 java.util.Date getLastAccessDate()
          Gets the last access date for this User.
 java.util.Date getLastLogin()
          Returns the user's last login date.
 java.lang.String getLastName()
          Returns the last name for this user.
 java.lang.String getPassword()
          Returns the user's password.
 java.lang.Object getPerm(java.lang.String name)
          Get an object from permanent storage.
 java.lang.Object getPerm(java.lang.String name, java.lang.Object def)
          Get an object from permanent storage; return default if value is null.
 java.util.Hashtable getPermStorage()
          This should only be used in the case where we want to save the data to the database.
 java.lang.Object getTemp(java.lang.String name)
          Get an object from temporary storage.
 java.lang.Object getTemp(java.lang.String name, java.lang.Object def)
          Get an object from temporary storage; return default if value is null.
 java.util.Hashtable getTempStorage()
          This should only be used in the case where we want to save the data to the database.
 java.lang.String getUserName()
          Deprecated. This is the same as getName(), so use this.
 boolean hasLoggedIn()
          The user is considered logged in if they have not timed out.
 void incrementAccessCounter()
          Increments the permanent hit counter for the user.
 void incrementAccessCounterForSession()
          Increments the session hit counter for the user.
 boolean isConfirmed()
          This method reports whether or not the user has been confirmed in the system by checking the TurbineUserPeer.CONFIRM_VALUE column to see if it is equal to CONFIRM_DATA.
 java.lang.Object removeTemp(java.lang.String name)
          Remove an object from temporary storage and return the object.
 void setAccessCounter(int cnt)
          Sets the access counter for a user, saved in perm storage.
 void setAccessCounterForSession(int cnt)
          Sets the session access counter for a user, saved in temp storage.
 void setConfirmed(java.lang.String value)
          Sets the confirmation value.
 void setCreateDate(java.util.Date date)
          Sets the creation date for this user.
 void setEmail(java.lang.String address)
          Sets the email address.
 void setFirstName(java.lang.String firstName)
          Sets the first name for this user.
 void setHasLoggedIn(java.lang.Boolean value)
          This sets whether or not someone has logged in.
 void setLastAccessDate()
          Sets the last access date for this User.
 void setLastLogin(java.util.Date lastLogin)
          Set last login date/time.
 void setLastName(java.lang.String lastName)
          Sets the last name for this user.
 void setPassword(java.lang.String password)
          Set password.
 void setPerm(java.lang.String name, java.lang.Object value)
          Put an object into permanent storage.
 void setPermStorage(java.util.Hashtable storage)
          This should only be used in the case where we want to save the data to the database.
 void setTemp(java.lang.String name, java.lang.Object value)
          Put an object into temporary storage.
 void setTempStorage(java.util.Hashtable storage)
          This should only be used in the case where we want to save the data to the database.
 void setUserName(java.lang.String username)
          Deprecated. This is the same as setName(), so use this.
 void updateLastLogin()
          Updates the last login date in the database.
 
Methods inherited from interface javax.servlet.http.HttpSessionBindingListener
valueBound, valueUnbound
 
Methods inherited from interface org.apache.turbine.om.security.SecurityEntity
getId, getIdAsObj, getName, setId, setName
 

Field Detail

FIRST_NAME

public static final java.lang.String FIRST_NAME
The 'perm storage' key name for the first name.

See Also:
Constant Field Values

LAST_NAME

public static final java.lang.String LAST_NAME
The 'perm storage' key name for the last name.

See Also:
Constant Field Values

LAST_LOGIN

public static final java.lang.String LAST_LOGIN
The 'perm storage' key name for the last_login field.

See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
The 'perm storage' key name for the password field.

See Also:
Constant Field Values

USERNAME

public static final java.lang.String USERNAME
The 'perm storage' key name for the username field.

See Also:
Constant Field Values

CONFIRM_VALUE

public static final java.lang.String CONFIRM_VALUE
The 'perm storage' key for the confirm_value field.

See Also:
Constant Field Values

EMAIL

public static final java.lang.String EMAIL
The 'perm storage' key for the email field.

See Also:
Constant Field Values

CONFIRM_DATA

public static final java.lang.String CONFIRM_DATA
This is the value that is stored in the database for confirmed users

See Also:
Constant Field Values

ACCESS_COUNTER

public static final java.lang.String ACCESS_COUNTER
The 'perm storage' key name for the access counter.

See Also:
Constant Field Values

SESSION_ACCESS_COUNTER

public static final java.lang.String SESSION_ACCESS_COUNTER
The 'temp storage' key name for the session access counter

See Also:
Constant Field Values

HAS_LOGGED_IN

public static final java.lang.String HAS_LOGGED_IN
The 'temp storage' key name for the 'has logged in' flag

See Also:
Constant Field Values

SESSION_KEY

public static final java.lang.String SESSION_KEY
The session key for the User object.

See Also:
Constant Field Values
Method Detail

getAccessCounter

public int getAccessCounter()
Gets the access counter for a user from perm storage.

Returns:
The access counter for the user.

getAccessCounterForSession

public int getAccessCounterForSession()
Gets the access counter for a user during a session.

Returns:
The access counter for the user for the session.

getLastAccessDate

public java.util.Date getLastAccessDate()
Gets the last access date for this User. This is the last time that the user object was referenced.

Returns:
A Java Date with the last access date for the user.

getCreateDate

public java.util.Date getCreateDate()
Gets the create date for this User. This is the time at which the user object was created.

Returns:
A Java Date with the date of creation for the user.

getLastLogin

public java.util.Date getLastLogin()
Returns the user's last login date.

Returns:
A Java Date with the last login date for the user.

getPassword

public java.lang.String getPassword()
Returns the user's password. This method should not be used by the application directly, because it's meaning depends upon the implementation of UserManager that manages this particular user object. Some implementations will use this attribute for storing a password encrypted in some way, other will not use it at all, when user entered password is presented to some external authority (like NT domain controller) to validate it. See also UserManager.authenticate(User,String).

Returns:
A String with the password for the user.

getPerm

public java.lang.Object getPerm(java.lang.String name)
Get an object from permanent storage.

Parameters:
name - The object's name.
Returns:
An Object with the given name.

getPerm

public java.lang.Object getPerm(java.lang.String name,
                                java.lang.Object def)
Get an object from permanent storage; return default if value is null.

Parameters:
name - The object's name.
def - A default value to return.
Returns:
An Object with the given name.

getPermStorage

public java.util.Hashtable getPermStorage()
This should only be used in the case where we want to save the data to the database.

Returns:
A Hashtable.

getTempStorage

public java.util.Hashtable getTempStorage()
This should only be used in the case where we want to save the data to the database.

Returns:
A Hashtable.

getTemp

public java.lang.Object getTemp(java.lang.String name)
Get an object from temporary storage.

Parameters:
name - The object's name.
Returns:
An Object with the given name.

getTemp

public java.lang.Object getTemp(java.lang.String name,
                                java.lang.Object def)
Get an object from temporary storage; return default if value is null.

Parameters:
name - The object's name.
def - A default value to return.
Returns:
An Object with the given name.

getUserName

public java.lang.String getUserName()
Deprecated. This is the same as getName(), so use this.

Returns the username for this user.

Returns:
A String with the username.

getFirstName

public java.lang.String getFirstName()
Returns the first name for this user.

Returns:
A String with the user's first name.

getLastName

public java.lang.String getLastName()
Returns the last name for this user.

Returns:
A String with the user's last name.

getEmail

public java.lang.String getEmail()
Returns the email address for this user.

Returns:
A String with the user's email address.

setHasLoggedIn

public void setHasLoggedIn(java.lang.Boolean value)
This sets whether or not someone has logged in. hasLoggedIn() returns this value.

Parameters:
value - Whether someone has logged in or not.

hasLoggedIn

public boolean hasLoggedIn()
The user is considered logged in if they have not timed out.

Returns:
True if the user has logged in.

incrementAccessCounter

public void incrementAccessCounter()
Increments the permanent hit counter for the user.


incrementAccessCounterForSession

public void incrementAccessCounterForSession()
Increments the session hit counter for the user.


removeTemp

public java.lang.Object removeTemp(java.lang.String name)
Remove an object from temporary storage and return the object.

Parameters:
name - The name of the object to remove.
Returns:
An Object.

setAccessCounter

public void setAccessCounter(int cnt)
Sets the access counter for a user, saved in perm storage.

Parameters:
cnt - The new count.

setAccessCounterForSession

public void setAccessCounterForSession(int cnt)
Sets the session access counter for a user, saved in temp storage.

Parameters:
cnt - The new count.

setLastAccessDate

public void setLastAccessDate()
Sets the last access date for this User. This is the last time that the user object was referenced.


setLastLogin

public void setLastLogin(java.util.Date lastLogin)
Set last login date/time.

Parameters:
lastLogin - The last login date.

setPassword

public void setPassword(java.lang.String password)
Set password. Application should not use this method directly, see getPassword(). See also UserManager.changePassword(User,String,String).

Parameters:
password - The new password.

setPerm

public void setPerm(java.lang.String name,
                    java.lang.Object value)
Put an object into permanent storage.

Parameters:
name - The object's name.
value - The object.

setPermStorage

public void setPermStorage(java.util.Hashtable storage)
This should only be used in the case where we want to save the data to the database.

Parameters:
storage - A Hashtable.

setTempStorage

public void setTempStorage(java.util.Hashtable storage)
This should only be used in the case where we want to save the data to the database.

Parameters:
storage - A Hashtable.

setTemp

public void setTemp(java.lang.String name,
                    java.lang.Object value)
Put an object into temporary storage.

Parameters:
name - The object's name.
value - The object.

setUserName

public void setUserName(java.lang.String username)
Deprecated. This is the same as setName(), so use this.

Sets the username for this user.

Parameters:
username - The user's username.

setFirstName

public void setFirstName(java.lang.String firstName)
Sets the first name for this user.

Parameters:
firstName - User's first name.

setLastName

public void setLastName(java.lang.String lastName)
Sets the last name for this user.

Parameters:
lastName - User's last name.

setCreateDate

public void setCreateDate(java.util.Date date)
Sets the creation date for this user.

Parameters:
date - Creation date

setEmail

public void setEmail(java.lang.String address)
Sets the email address.

Parameters:
address - The email address.

isConfirmed

public boolean isConfirmed()
This method reports whether or not the user has been confirmed in the system by checking the TurbineUserPeer.CONFIRM_VALUE column to see if it is equal to CONFIRM_DATA.

Returns:
True if the user has been confirmed.

setConfirmed

public void setConfirmed(java.lang.String value)
Sets the confirmation value.

Parameters:
value - The confirmation key value.

getConfirmed

public java.lang.String getConfirmed()
Gets the confirmation value.

Returns:
The confirmed value

updateLastLogin

public void updateLastLogin()
                     throws java.lang.Exception
Updates the last login date in the database.

Throws:
java.lang.Exception - A generic exception.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.