Package org.apache.turbine.om.security
Interface User
-
- All Superinterfaces:
EventListener,org.apache.fulcrum.security.entity.ExtendedUser,HttpSessionBindingListener,org.apache.fulcrum.security.entity.SecurityEntity,Serializable,org.apache.fulcrum.security.model.turbine.entity.TurbineUser,TurbineUserDelegate,org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity,org.apache.fulcrum.security.entity.User
- All Known Implementing Classes:
DefaultUserImpl
public interface User extends HttpSessionBindingListener, TurbineUserDelegate, org.apache.fulcrum.security.model.turbine.entity.TurbineUser
This interface represents functionality that all users of the Turbine system require.- Version:
- $Id$
- Author:
- Frank Y. Kim, John D. McNally, Jon S. Stevens, Craig D. Berry, Henning P. Schmiedehausen
-
-
Field Summary
Fields Modifier and Type Field Description static StringACCESS_COUNTERThe 'perm storage' key name for the access counter.static StringCONFIRM_DATAThis is the value that is stored in the database for confirmed usersstatic StringCONFIRM_VALUEThe 'perm storage' key for the confirm_value field.static StringCREATE_DATEThe 'perm storage' key name for the create_date field.static StringHAS_LOGGED_INThe 'temp storage' key name for the 'has logged in' flagstatic StringLAST_LOGINThe 'perm storage' key name for the last_login field.static StringSESSION_ACCESS_COUNTERThe 'temp storage' key name for the session access counterstatic StringSESSION_KEYThe session key for the User object.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetAccessCounter()Gets the access counter for a user from perm storage.intgetAccessCounterForSession()Gets the access counter for a user during a session.StringgetConfirmed()Gets the confirmation value.DategetCreateDate()Gets the create date for this User.DategetLastAccessDate()Gets the last access date for this User.DategetLastLogin()Returns the user's last login date.ObjectgetPerm(String name)Get an object from permanent storage.ObjectgetPerm(String name, Object def)Get an object from permanent storage; return default if value is null.Map<String,Object>getPermStorage()This should only be used in the case where we want to save the data to the database.ObjectgetTemp(String name)Get an object from temporary storage.ObjectgetTemp(String name, Object def)Get an object from temporary storage; return default if value is null.Map<String,Object>getTempStorage()This should only be used in the case where we want to save the data to the database.booleanhasLoggedIn()The user is considered logged in if they have not timed out.voidincrementAccessCounter()Increments the permanent hit counter for the user.voidincrementAccessCounterForSession()Increments the session hit counter for the user.booleanisConfirmed()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.ObjectremoveTemp(String name)Remove an object from temporary storage and return the object.voidsetAccessCounter(int cnt)Sets the access counter for a user, saved in perm storage.voidsetAccessCounterForSession(int cnt)Sets the session access counter for a user, saved in temp storage.voidsetConfirmed(String value)Sets the confirmation value.voidsetCreateDate(Date date)Sets the creation date for this user.voidsetHasLoggedIn(Boolean value)This sets whether or not someone has logged in.voidsetLastAccessDate()Sets the last access date for this User.voidsetLastLogin(Date lastLogin)Set last login date/time.voidsetPerm(String name, Object value)Put an object into permanent storage.voidsetPermStorage(Map<String,Object> storage)This should only be used in the case where we want to save the data to the database.voidsetTemp(String name, Object value)Put an object into temporary storage.voidsetTempStorage(Map<String,Object> storage)This should only be used in the case where we want to save the data to the database.voidupdateLastLogin()Updates the last login date in the database.-
Methods inherited from interface org.apache.fulcrum.security.entity.ExtendedUser
getEmail, getFirstName, getLastName, getObjectdata, setEmail, setFirstName, setLastName, setObjectdata
-
Methods inherited from interface javax.servlet.http.HttpSessionBindingListener
valueBound, valueUnbound
-
Methods inherited from interface org.apache.fulcrum.security.entity.SecurityEntity
getId, getName, setId, setName
-
Methods inherited from interface org.apache.turbine.om.security.TurbineUserDelegate
getUserDelegate, setUserDelegate
-
-
-
-
Field Detail
-
CREATE_DATE
static final String CREATE_DATE
The 'perm storage' key name for the create_date field.- See Also:
- Constant Field Values
-
LAST_LOGIN
static final String LAST_LOGIN
The 'perm storage' key name for the last_login field.- See Also:
- Constant Field Values
-
CONFIRM_VALUE
static final String CONFIRM_VALUE
The 'perm storage' key for the confirm_value field.- See Also:
- Constant Field Values
-
CONFIRM_DATA
static final String CONFIRM_DATA
This is the value that is stored in the database for confirmed users- See Also:
- Constant Field Values
-
ACCESS_COUNTER
static final String ACCESS_COUNTER
The 'perm storage' key name for the access counter.- See Also:
- Constant Field Values
-
SESSION_ACCESS_COUNTER
static final String SESSION_ACCESS_COUNTER
The 'temp storage' key name for the session access counter- See Also:
- Constant Field Values
-
HAS_LOGGED_IN
static final String HAS_LOGGED_IN
The 'temp storage' key name for the 'has logged in' flag- See Also:
- Constant Field Values
-
SESSION_KEY
static final String SESSION_KEY
The session key for the User object.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAccessCounter
int getAccessCounter()
Gets the access counter for a user from perm storage.- Returns:
- The access counter for the user.
-
getAccessCounterForSession
int getAccessCounterForSession()
Gets the access counter for a user during a session.- Returns:
- The access counter for the user for the session.
-
getLastAccessDate
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
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
Date getLastLogin()
Returns the user's last login date.- Returns:
- A Java Date with the last login date for the user.
-
getPerm
Object getPerm(String name)
Get an object from permanent storage.- Parameters:
name- The object's name.- Returns:
- An Object with the given name.
-
getPerm
Object getPerm(String name, 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
Map<String,Object> getPermStorage()
This should only be used in the case where we want to save the data to the database.- Returns:
- A Map.
-
getTempStorage
Map<String,Object> getTempStorage()
This should only be used in the case where we want to save the data to the database.- Returns:
- A Map.
-
getTemp
Object getTemp(String name)
Get an object from temporary storage.- Parameters:
name- The object's name.- Returns:
- An Object with the given name.
-
getTemp
Object getTemp(String name, 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.
-
setHasLoggedIn
void setHasLoggedIn(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
boolean hasLoggedIn()
The user is considered logged in if they have not timed out.- Returns:
- True if the user has logged in.
-
incrementAccessCounter
void incrementAccessCounter()
Increments the permanent hit counter for the user.
-
incrementAccessCounterForSession
void incrementAccessCounterForSession()
Increments the session hit counter for the user.
-
removeTemp
Object removeTemp(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
void setAccessCounter(int cnt)
Sets the access counter for a user, saved in perm storage.- Parameters:
cnt- The new count.
-
setAccessCounterForSession
void setAccessCounterForSession(int cnt)
Sets the session access counter for a user, saved in temp storage.- Parameters:
cnt- The new count.
-
setLastAccessDate
void setLastAccessDate()
Sets the last access date for this User. This is the last time that the user object was referenced.
-
setLastLogin
void setLastLogin(Date lastLogin)
Set last login date/time.- Parameters:
lastLogin- The last login date.
-
setPerm
void setPerm(String name, Object value)
Put an object into permanent storage.- Parameters:
name- The object's name.value- The object.
-
setPermStorage
void setPermStorage(Map<String,Object> storage)
This should only be used in the case where we want to save the data to the database.- Parameters:
storage- A Map.
-
setTempStorage
void setTempStorage(Map<String,Object> storage)
This should only be used in the case where we want to save the data to the database.- Parameters:
storage- A Map.
-
setTemp
void setTemp(String name, Object value)
Put an object into temporary storage.- Parameters:
name- The object's name.value- The object.
-
setCreateDate
void setCreateDate(Date date)
Sets the creation date for this user.- Parameters:
date- Creation date
-
isConfirmed
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
void setConfirmed(String value)
Sets the confirmation value.- Parameters:
value- The confirmation key value.
-
getConfirmed
String getConfirmed()
Gets the confirmation value.- Returns:
- The confirmed value
-
updateLastLogin
void updateLastLogin() throws Exception
Updates the last login date in the database.- Throws:
Exception- A generic exception.
-
-