public class DefaultUserImpl extends Object implements User
ACCESS_COUNTER, CONFIRM_DATA, CONFIRM_VALUE, CREATE_DATE, HAS_LOGGED_IN, LAST_LOGIN, SESSION_ACCESS_COUNTER, SESSION_KEY
Constructor and Description |
---|
DefaultUserImpl(org.apache.fulcrum.security.model.turbine.entity.TurbineUser user)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole)
Add a User/Group/Role relation to this entity
|
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()
Returns the confirm value of the user
|
Date |
getCreateDate()
Returns the creation date of the user
|
String |
getEmail()
Returns the email address for this user.
|
String |
getFirstName()
Returns the first name for this user.
|
Object |
getId()
Get the Id of the SecurityEntity.
|
Date |
getLastAccessDate()
Gets the last access date for this User.
|
Date |
getLastLogin()
Returns the date of the last login of the user
|
String |
getLastName()
Returns the last name for this user.
|
String |
getName()
Get the Name of the SecurityEntity.
|
byte[] |
getObjectdata()
Returns the value of the objectdata for this user.
|
String |
getPassword()
Returns the user's password.
|
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.
|
Map<String,Object> |
getPermStorage()
Returns the permanent storage.
|
Object |
getTemp(String name)
Get an object from temporary storage.
|
Object |
getTemp(String name,
Object def)
Get an object from temporary storage; return default if value
is null.
|
Map<String,Object> |
getTempStorage()
Returns the temporary storage.
|
org.apache.fulcrum.security.model.turbine.entity.TurbineUser |
getUserDelegate()
Get the delegated user
|
<T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole> |
getUserGroupRoleSet()
Get the User/Group/Role set associated with this entity
|
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 |
removeUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole)
Remove a User/Group/Role relation from this entity
|
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 confirm)
Sets the new confirm value of the user
|
void |
setCreateDate(Date createDate)
Sets the new creation date of the 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 |
setId(Object id)
Sets the Id of the SecurityEntity.
|
void |
setLastAccessDate()
Sets the last access date for this User.
|
void |
setLastLogin(Date lastLogin)
Sets the new date of the last login of the user
|
void |
setLastName(String lastName)
Sets the last name for this user.
|
void |
setName(String name)
Sets the Name of the SecurityEntity.
|
void |
setObjectdata(byte[] objectdata)
Sets the value of the objectdata for the user
|
void |
setPassword(String password)
Set password.
|
void |
setPerm(String name,
Object value)
Put an object into permanent storage.
|
void |
setPermStorage(Map<String,Object> permStorage)
This should only be used in the case where we want to make the
data persistent.
|
void |
setTemp(String name,
Object value)
Put an object into temporary storage.
|
void |
setTempStorage(Map<String,Object> tempStorage)
This should only be used in the case where we want to save the
data to the database.
|
void |
setUserDelegate(org.apache.fulcrum.security.model.turbine.entity.TurbineUser userDelegate)
Set the delegated user
|
<T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole> |
setUserGroupRoleSet(Set<T> userGroupRoleSet)
Set the User/Group/Role set associated with this entity
|
void |
updateLastLogin()
Updates the last login date in the database.
|
void |
valueBound(HttpSessionBindingEvent hsbe)
Implement this method if you wish to be notified when the User
has been Bound to the session.
|
void |
valueUnbound(HttpSessionBindingEvent hsbe)
Implement this method if you wish to be notified when the User
has been Unbound from the session.
|
public DefaultUserImpl(org.apache.fulcrum.security.model.turbine.entity.TurbineUser user)
user
- the user object to wrappublic void valueBound(HttpSessionBindingEvent hsbe)
valueBound
in interface HttpSessionBindingListener
hsbe
- Indication of value/session binding.public void valueUnbound(HttpSessionBindingEvent hsbe)
valueUnbound
in interface HttpSessionBindingListener
hsbe
- Indication of value/session unbinding.public String getName()
getName
in interface org.apache.fulcrum.security.entity.SecurityEntity
public void setName(String name)
setName
in interface org.apache.fulcrum.security.entity.SecurityEntity
name
- Name of the SecurityEntity.public Object getId()
getId
in interface org.apache.fulcrum.security.entity.SecurityEntity
public void setId(Object id)
setId
in interface org.apache.fulcrum.security.entity.SecurityEntity
id
- The new Id of the SecurityEntitypublic String getPassword()
UserManager.authenticate(User,String)
.getPassword
in interface org.apache.fulcrum.security.entity.User
public void setPassword(String password)
getPassword()
.
See also UserManager.changePassword(User,String,String)
.setPassword
in interface org.apache.fulcrum.security.entity.User
password
- The new password.public String getFirstName()
getFirstName
in interface org.apache.fulcrum.security.entity.ExtendedUser
public void setFirstName(String firstName)
setFirstName
in interface org.apache.fulcrum.security.entity.ExtendedUser
firstName
- User's first name.public String getLastName()
getLastName
in interface org.apache.fulcrum.security.entity.ExtendedUser
public void setLastName(String lastName)
setLastName
in interface org.apache.fulcrum.security.entity.ExtendedUser
lastName
- User's last name.public String getEmail()
getEmail
in interface org.apache.fulcrum.security.entity.ExtendedUser
public void setEmail(String address)
setEmail
in interface org.apache.fulcrum.security.entity.ExtendedUser
address
- The email address.public byte[] getObjectdata()
getObjectdata
in interface org.apache.fulcrum.security.entity.ExtendedUser
public void setObjectdata(byte[] objectdata)
setObjectdata
in interface org.apache.fulcrum.security.entity.ExtendedUser
objectdata
- The new permanent storage for the userpublic <T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole> Set<T> getUserGroupRoleSet() throws org.apache.fulcrum.security.util.DataBackendException
getUserGroupRoleSet
in interface org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
org.apache.fulcrum.security.util.DataBackendException
- if there was an error accessing the data
backend.public <T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole> void setUserGroupRoleSet(Set<T> userGroupRoleSet)
setUserGroupRoleSet
in interface org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
userGroupRoleSet
- a set of User/Group/Role relationspublic void addUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole) throws org.apache.fulcrum.security.util.DataBackendException
addUserGroupRole
in interface org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
userGroupRole
- a User/Group/Role relation to addorg.apache.fulcrum.security.util.DataBackendException
- if there was an error accessing the data
backend.public void removeUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole) throws org.apache.fulcrum.security.util.DataBackendException
removeUserGroupRole
in interface org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
userGroupRole
- a User/Group/Role relation to removeorg.apache.fulcrum.security.util.DataBackendException
- if there was an error accessing the data
backend.public int getAccessCounter()
public int getAccessCounterForSession()
public void incrementAccessCounter()
public void incrementAccessCounterForSession()
public void setAccessCounter(int cnt)
cnt
- The new count.public void setAccessCounterForSession(int cnt)
cnt
- The new count.public Date getLastAccessDate()
public void setLastAccessDate()
public Map<String,Object> getPermStorage()
public void setPermStorage(Map<String,Object> permStorage)
permStorage
- A Map.public Map<String,Object> getTempStorage()
public void setTempStorage(Map<String,Object> tempStorage)
tempStorage
- A Map.public Object getPerm(String name)
name
- The object's name.public Object getPerm(String name, Object def)
name
- The object's name.def
- A default value to return.public void setPerm(String name, Object value)
name
- The object's name.value
- The object.public Object getTemp(String name)
name
- The object's name.public Object getTemp(String name, Object def)
name
- The object's name.def
- A default value to return.public void setTemp(String name, Object value)
name
- The object's name.value
- The object.public Object removeTemp(String name)
name
- The name of the object to remove.public String getConfirmed()
public void setConfirmed(String confirm)
confirm
- The new confirm value of the userpublic Date getCreateDate()
public void setCreateDate(Date createDate)
createDate
- The new creation date of the userpublic Date getLastLogin()
public void setLastLogin(Date lastLogin)
lastLogin
- The new the date of the last login of the userpublic boolean hasLoggedIn()
public void setHasLoggedIn(Boolean value)
value
- Whether someone has logged in or not.public boolean isConfirmed()
public void updateLastLogin() throws Exception
Exception
- A generic exception.public org.apache.fulcrum.security.model.turbine.entity.TurbineUser getUserDelegate()
TurbineUserDelegate
getUserDelegate
in interface TurbineUserDelegate
public void setUserDelegate(org.apache.fulcrum.security.model.turbine.entity.TurbineUser userDelegate)
TurbineUserDelegate
setUserDelegate
in interface TurbineUserDelegate
userDelegate
- the userDelegate to setCopyright © 2000–2019 The Apache Software Foundation. All rights reserved.