|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.om.security.SecurityObject<User>
org.apache.turbine.om.security.TurbineUser
public class TurbineUser
A generic implementation of User interface.
This basic implementation contains the functionality that is
expected to be common among all User implementations.
You are welcome to extend this class if you wish to have
custom functionality in your user objects (like accessor methods
for custom attributes). Note that implementing a different scheme
of user data storage normally involves writing an implementation of
UserManager
interface.
Field Summary |
---|
Fields inherited from interface org.apache.turbine.om.security.User |
---|
ACCESS_COUNTER, CONFIRM_DATA, CONFIRM_VALUE, EMAIL, FIRST_NAME, HAS_LOGGED_IN, LAST_LOGIN, LAST_NAME, PASSWORD, SESSION_ACCESS_COUNTER, SESSION_KEY, USERNAME |
Constructor Summary | |
---|---|
TurbineUser()
Constructor. |
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. |
String |
getConfirmed()
Gets the confirmation value. |
Date |
getCreateDate()
Gets the create date for this User. |
String |
getEmail()
Returns the email address for this user. |
String |
getFirstName()
Returns the first name for this user. |
Date |
getLastAccessDate()
Gets the last access date for this User. |
Date |
getLastLogin()
Get last login date/time for this user. |
String |
getLastName()
Returns the last name for this user. |
String |
getName()
Returns the name of this user. |
String |
getPassword()
Get password for this user. |
Object |
getPerm(String name)
Get an object from permanent storage. |
Object |
getPerm(String name,
Object def)
Get an object from permanent storage; return default if value is null. |
Hashtable<String,Object> |
getPermStorage()
This should only be used in the case where we want to save the data to the database. |
Object |
getTemp(String name)
Get an object from temporary storage; return null if the object can't be found. |
Object |
getTemp(String name,
Object def)
Get an object from temporary storage; return default if value is null. |
Hashtable<String,Object> |
getTempStorage()
This should only be used in the case where we want to save the data to the database. |
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 User.CONFIRM_VALUE column in the users record to see if it is equal to User.CONFIRM_DATA. |
Object |
removeTemp(String name)
Remove an object from temporary storage and return the object. |
void |
save()
Saves this object to the data store. |
void |
save(Connection conn)
not implemented |
void |
save(String dbname)
not implemented |
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(String value)
Sets the confirmation value. |
void |
setCreateDate(Date date)
Sets the create date for this User. |
void |
setEmail(String address)
Sets the email address. |
void |
setFirstName(String firstName)
Sets the first name for this user. |
void |
setHasLoggedIn(Boolean value)
This sets whether or not someone has logged in. |
void |
setLastAccessDate()
Sets the last access date for this User. |
void |
setLastLogin(Date date)
Set last login date/time. |
void |
setLastName(String lastName)
Sets the last name for this user. |
void |
setName(String name)
Sets the name of this user. |
void |
setPassword(String password)
Set password. |
void |
setPerm(String name,
Object value)
Put an object into permanent storage. |
void |
setPermStorage(Hashtable<String,Object> permStorage)
This should only be used in the case where we want to save the data to the database. |
void |
setTemp(String name,
Object value)
Put an object into temporary storage. |
void |
setTempStorage(Hashtable<String,Object> tempStorage)
This should only be used in the case where we want to save the data to the database. |
void |
updateLastLogin()
Updates the last login date in the database. |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent hsbe)
Implement this method if you wish to be notified when the User has been Bound to the session. |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent hsbe)
Implement this method if you wish to be notified when the User has been Unbound from the session. |
Methods inherited from class org.apache.turbine.om.security.SecurityObject |
---|
compareTo, getAttribute, getAttributes, getId, getIdAsObj, setAttribute, setAttributes, setId, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.turbine.om.security.SecurityEntity |
---|
getId, getIdAsObj, setId |
Constructor Detail |
---|
public TurbineUser()
Method Detail |
---|
public int getAccessCounterForSession()
getAccessCounterForSession
in interface User
public int getAccessCounter()
getAccessCounter
in interface User
public Date getCreateDate()
getCreateDate
in interface User
public Date getLastAccessDate()
getLastAccessDate
in interface User
public Date getLastLogin()
getLastLogin
in interface User
public String getPassword()
getPassword
in interface User
public Object getPerm(String name)
getPerm
in interface User
name
- The object's name.
public Object getPerm(String name, Object def)
getPerm
in interface User
name
- The object's name.def
- A default value to return.
public Hashtable<String,Object> getPermStorage()
getPermStorage
in interface User
public Object getTemp(String name)
getTemp
in interface User
name
- The object's name.
public Object getTemp(String name, Object def)
getTemp
in interface User
name
- The object's name.def
- A default value to return.
public String getFirstName()
getFirstName
in interface User
public String getLastName()
getLastName
in interface User
public boolean hasLoggedIn()
hasLoggedIn
in interface User
public String getEmail()
getEmail
in interface User
public void incrementAccessCounter()
incrementAccessCounter
in interface User
public void incrementAccessCounterForSession()
incrementAccessCounterForSession
in interface User
public Object removeTemp(String name)
removeTemp
in interface User
name
- The name of the object to remove.
public void setAccessCounter(int cnt)
setAccessCounter
in interface User
cnt
- The new count.public void setAccessCounterForSession(int cnt)
setAccessCounterForSession
in interface User
cnt
- The new count.public void setLastAccessDate()
setLastAccessDate
in interface User
public void setCreateDate(Date date)
setCreateDate
in interface User
date
- The create date.public void setLastLogin(Date date)
setLastLogin
in interface User
date
- The last login date.public void setPassword(String password)
setPassword
in interface User
password
- The new password.public void setPerm(String name, Object value)
setPerm
in interface User
name
- The object's name.value
- The object.public void setPermStorage(Hashtable<String,Object> permStorage)
setPermStorage
in interface User
permStorage
- A Hashtable.public Hashtable<String,Object> getTempStorage()
getTempStorage
in interface User
public void setTempStorage(Hashtable<String,Object> tempStorage)
setTempStorage
in interface User
storage
- A Hashtable.public void setHasLoggedIn(Boolean value)
setHasLoggedIn
in interface User
value
- Whether someone has logged in or not.public void setTemp(String name, Object value)
setTemp
in interface User
name
- The object's name.value
- The object.public void setFirstName(String firstName)
setFirstName
in interface User
firstName
- User's first name.public void setLastName(String lastName)
setLastName
in interface User
lastName
- User's last name.public void setEmail(String address)
setEmail
in interface User
address
- The email address.public boolean isConfirmed()
isConfirmed
in interface User
public void setConfirmed(String value)
setConfirmed
in interface User
value
- The confirmation key value.public String getConfirmed()
getConfirmed
in interface User
public void updateLastLogin() throws Exception
updateLastLogin
in interface User
Exception
- a generic exception.public void valueBound(javax.servlet.http.HttpSessionBindingEvent hsbe)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
hsbe
- The HttpSessionBindingEvent.public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent hsbe)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
hsbe
- The HttpSessionBindingEvent.public void save() throws Exception
Exception
public void save(Connection conn) throws Exception
conn
-
Exception
public void save(String dbname) throws Exception
dbname
-
Exception
public String getName()
getName
in interface SecurityEntity
getName
in class SecurityObject<User>
public void setName(String name)
setName
in interface SecurityEntity
setName
in class SecurityObject<User>
name
- The name of the object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |