Package org.apache.turbine.om.security
Class DefaultUserImpl
java.lang.Object
org.apache.turbine.om.security.DefaultUserImpl
- All Implemented Interfaces:
- jakarta.servlet.http.HttpSessionBindingListener,- Serializable,- EventListener,- org.apache.fulcrum.security.entity.ExtendedUser,- org.apache.fulcrum.security.entity.SecurityEntity,- org.apache.fulcrum.security.entity.User,- org.apache.fulcrum.security.model.turbine.entity.TurbineUser,- org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity,- TurbineUserDelegate,- User
This is the Default user implementation. It is a wrapper around
 a TurbineUser object
- Version:
- $Id: TorqueUser.java 1199856 2011-11-09 17:06:04Z tv $
- Author:
- Thomas Vandahl
- See Also:
- 
Field SummaryFields inherited from interface org.apache.turbine.om.security.UserACCESS_COUNTER, CONFIRM_DATA, CONFIRM_VALUE, CREATE_DATE, HAS_LOGGED_IN, LAST_LOGIN, SESSION_ACCESS_COUNTER, SESSION_KEY
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultUserImpl(org.apache.fulcrum.security.model.turbine.entity.TurbineUser user) Constructor
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole) Add a User/Group/Role relation to this entityintGets the access counter for a user from perm storage.intGets the access counter for a user during a session.Returns the confirm value of the userReturns the creation date of the usergetEmail()Returns the email address for this user.Returns the first name for this user.getId()Get the Id of the SecurityEntity.Gets the last access date for this User.Returns the date of the last login of the userReturns the last name for this user.getName()Get the Name of the SecurityEntity.byte[]Returns the value of the objectdata for this user.Returns the user's password.Get an object from permanent storage.Get an object from permanent storage; return default if value is null.Returns the permanent storage.Get an object from temporary storage.Get an object from temporary storage; return default if value is null.Returns the temporary storage.org.apache.fulcrum.security.model.turbine.entity.TurbineUserGet the delegated user<T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole>
 Set<T> Get the User/Group/Role set associated with this entitybooleanThe user is considered logged in if they have not timed out.voidIncrements the permanent hit counter for the user.voidIncrements the session hit counter for the user.booleanThis 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.removeTemp(String name) Remove an object from temporary storage and return the object.voidremoveUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole) Remove a User/Group/Role relation from this entityvoidsetAccessCounter(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 confirm) Sets the new confirm value of the uservoidsetCreateDate(Date createDate) Sets the new creation date of the uservoidSets the email address.voidsetFirstName(String firstName) Sets the first name for this user.voidsetHasLoggedIn(Boolean value) This sets whether or not someone has logged in.voidSets the Id of the SecurityEntity.voidSets the last access date for this User.voidsetLastLogin(Date lastLogin) Sets the new date of the last login of the uservoidsetLastName(String lastName) Sets the last name for this user.voidSets the Name of the SecurityEntity.voidsetObjectdata(byte[] objectdata) Sets the value of the objectdata for the uservoidsetPassword(String password) Set password.voidPut an object into permanent storage.voidsetPermStorage(Map<String, Object> permStorage) This should only be used in the case where we want to make the data persistent.voidPut an object into temporary storage.voidsetTempStorage(Map<String, Object> tempStorage) This should only be used in the case where we want to save the data to the database.final voidsetUserDelegate(org.apache.fulcrum.security.model.turbine.entity.TurbineUser userDelegate) Set the delegated user<T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole>
 voidsetUserGroupRoleSet(Set<T> userGroupRoleSet) Set the User/Group/Role set associated with this entityvoidUpdates the last login date in the database.voidvalueBound(jakarta.servlet.http.HttpSessionBindingEvent hsbe) Implement this method if you wish to be notified when the User has been Bound to the session.voidvalueUnbound(jakarta.servlet.http.HttpSessionBindingEvent hsbe) Implement this method if you wish to be notified when the User has been Unbound from the session.
- 
Constructor Details- 
DefaultUserImplConstructor- Parameters:
- user- the user object to wrap
 
 
- 
- 
Method Details- 
valueBoundImplement this method if you wish to be notified when the User has been Bound to the session.- Specified by:
- valueBoundin interface- jakarta.servlet.http.HttpSessionBindingListener
- Parameters:
- hsbe- Indication of value/session binding.
 
- 
valueUnboundImplement this method if you wish to be notified when the User has been Unbound from the session.- Specified by:
- valueUnboundin interface- jakarta.servlet.http.HttpSessionBindingListener
- Parameters:
- hsbe- Indication of value/session unbinding.
 
- 
getNameGet the Name of the SecurityEntity.- Specified by:
- getNamein interface- org.apache.fulcrum.security.entity.SecurityEntity
- Returns:
- The Name of the SecurityEntity.
 
- 
setNameSets the Name of the SecurityEntity.- Specified by:
- setNamein interface- org.apache.fulcrum.security.entity.SecurityEntity
- Parameters:
- name- Name of the SecurityEntity.
 
- 
getIdGet the Id of the SecurityEntity.- Specified by:
- getIdin interface- org.apache.fulcrum.security.entity.SecurityEntity
- Returns:
- The Id of the SecurityEntity.
 
- 
setIdSets the Id of the SecurityEntity.- Specified by:
- setIdin interface- org.apache.fulcrum.security.entity.SecurityEntity
- Parameters:
- id- The new Id of the SecurityEntity
 
- 
getPasswordReturns 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 alsoUserManager.authenticate(User,String).- Specified by:
- getPasswordin interface- org.apache.fulcrum.security.entity.User
- Returns:
- A String with the password for the user.
 
- 
setPasswordSet password. Application should not use this method directly, seegetPassword(). See alsoUserManager.changePassword(User,String,String).- Specified by:
- setPasswordin interface- org.apache.fulcrum.security.entity.User
- Parameters:
- password- The new password.
 
- 
getFirstNameReturns the first name for this user.- Specified by:
- getFirstNamein interface- org.apache.fulcrum.security.entity.ExtendedUser
- Returns:
- A String with the user's first name.
 
- 
setFirstNameSets the first name for this user.- Specified by:
- setFirstNamein interface- org.apache.fulcrum.security.entity.ExtendedUser
- Parameters:
- firstName- User's first name.
 
- 
getLastNameReturns the last name for this user.- Specified by:
- getLastNamein interface- org.apache.fulcrum.security.entity.ExtendedUser
- Returns:
- A String with the user's last name.
 
- 
setLastNameSets the last name for this user.- Specified by:
- setLastNamein interface- org.apache.fulcrum.security.entity.ExtendedUser
- Parameters:
- lastName- User's last name.
 
- 
getEmailReturns the email address for this user.- Specified by:
- getEmailin interface- org.apache.fulcrum.security.entity.ExtendedUser
- Returns:
- A String with the user's email address.
 
- 
setEmailSets the email address.- Specified by:
- setEmailin interface- org.apache.fulcrum.security.entity.ExtendedUser
- Parameters:
- address- The email address.
 
- 
getObjectdataReturns the value of the objectdata for this user. Objectdata is a storage area used to store the permanent storage table from the User object.- Specified by:
- getObjectdatain interface- org.apache.fulcrum.security.entity.ExtendedUser
- Returns:
- The bytes in the objectdata for this user
 
- 
setObjectdataSets the value of the objectdata for the user- Specified by:
- setObjectdatain interface- org.apache.fulcrum.security.entity.ExtendedUser
- Parameters:
- objectdata- The new permanent storage for the user
 
- 
getUserGroupRoleSetpublic <T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole> Set<T> getUserGroupRoleSet() throws org.apache.fulcrum.security.util.DataBackendExceptionGet the User/Group/Role set associated with this entity- Specified by:
- getUserGroupRoleSetin interface- org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
- Returns:
- a set of User/Group/Role relations
- Throws:
- org.apache.fulcrum.security.util.DataBackendException- if there was an error accessing the data backend.
 
- 
setUserGroupRoleSetpublic <T extends org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole> void setUserGroupRoleSet(Set<T> userGroupRoleSet) Set the User/Group/Role set associated with this entity- Specified by:
- setUserGroupRoleSetin interface- org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
- Parameters:
- userGroupRoleSet- a set of User/Group/Role relations
 
- 
addUserGroupRolepublic void addUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole) throws org.apache.fulcrum.security.util.DataBackendException Add a User/Group/Role relation to this entity- Specified by:
- addUserGroupRolein interface- org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
- Parameters:
- userGroupRole- a User/Group/Role relation to add
- Throws:
- org.apache.fulcrum.security.util.DataBackendException- if there was an error accessing the data backend.
 
- 
removeUserGroupRolepublic void removeUserGroupRole(org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole userGroupRole) throws org.apache.fulcrum.security.util.DataBackendException Remove a User/Group/Role relation from this entity- Specified by:
- removeUserGroupRolein interface- org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRoleEntity
- Parameters:
- userGroupRole- a User/Group/Role relation to remove
- Throws:
- org.apache.fulcrum.security.util.DataBackendException- if there was an error accessing the data backend.
 
- 
getAccessCounterGets the access counter for a user from perm storage.- Specified by:
- getAccessCounterin interface- User
- Returns:
- The access counter for the user.
 
- 
getAccessCounterForSessionGets the access counter for a user during a session.- Specified by:
- getAccessCounterForSessionin interface- User
- Returns:
- The access counter for the user for the session.
 
- 
incrementAccessCounterIncrements the permanent hit counter for the user.- Specified by:
- incrementAccessCounterin interface- User
 
- 
incrementAccessCounterForSessionIncrements the session hit counter for the user.- Specified by:
- incrementAccessCounterForSessionin interface- User
 
- 
setAccessCounterSets the access counter for a user, saved in perm storage.- Specified by:
- setAccessCounterin interface- User
- Parameters:
- cnt- The new count.
 
- 
setAccessCounterForSessionSets the session access counter for a user, saved in temp storage.- Specified by:
- setAccessCounterForSessionin interface- User
- Parameters:
- cnt- The new count.
 
- 
getLastAccessDateGets the last access date for this User. This is the last time that the user object was referenced.- Specified by:
- getLastAccessDatein interface- User
- Returns:
- A Java Date with the last access date for the user.
 
- 
setLastAccessDateSets the last access date for this User. This is the last time that the user object was referenced.- Specified by:
- setLastAccessDatein interface- User
 
- 
getPermStorageReturns the permanent storage. This is implemented as a Map- Specified by:
- getPermStoragein interface- User
- Returns:
- A Map.
 
- 
setPermStorageThis should only be used in the case where we want to make the data persistent.- Specified by:
- setPermStoragein interface- User
- Parameters:
- permStorage- A Map.
 
- 
getTempStorageReturns the temporary storage. This is implemented as a Map- Specified by:
- getTempStoragein interface- User
- Returns:
- A Map.
 
- 
setTempStorageThis should only be used in the case where we want to save the data to the database.- Specified by:
- setTempStoragein interface- User
- Parameters:
- tempStorage- A Map.
 
- 
getPermGet an object from permanent storage.
- 
getPermGet an object from permanent storage; return default if value is null.
- 
setPermPut an object into permanent storage.
- 
getTempGet an object from temporary storage.
- 
getTempGet an object from temporary storage; return default if value is null.
- 
setTempPut an object into temporary storage.
- 
removeTempRemove an object from temporary storage and return the object.- Specified by:
- removeTempin interface- User
- Parameters:
- name- The name of the object to remove.
- Returns:
- An Object.
 
- 
getConfirmedReturns the confirm value of the user- Specified by:
- getConfirmedin interface- User
- Returns:
- The confirm value of the user
 
- 
setConfirmedSets the new confirm value of the user- Specified by:
- setConfirmedin interface- User
- Parameters:
- confirm- The new confirm value of the user
 
- 
getCreateDateReturns the creation date of the user- Specified by:
- getCreateDatein interface- User
- Returns:
- The creation date of the user
 
- 
setCreateDateSets the new creation date of the user- Specified by:
- setCreateDatein interface- User
- Parameters:
- createDate- The new creation date of the user
 
- 
getLastLoginReturns the date of the last login of the user- Specified by:
- getLastLoginin interface- User
- Returns:
- The date of the last login of the user
 
- 
setLastLoginSets the new date of the last login of the user- Specified by:
- setLastLoginin interface- User
- Parameters:
- lastLogin- The new the date of the last login of the user
 
- 
hasLoggedInThe user is considered logged in if they have not timed out.- Specified by:
- hasLoggedInin interface- User
- Returns:
- Whether the user has logged in.
 
- 
setHasLoggedInThis sets whether or not someone has logged in. hasLoggedIn() returns this value.- Specified by:
- setHasLoggedInin interface- User
- Parameters:
- value- Whether someone has logged in or not.
 
- 
isConfirmedThis 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.- Specified by:
- isConfirmedin interface- User
- Returns:
- True if the user has been confirmed.
 
- 
updateLastLoginUpdates the last login date in the database.- Specified by:
- updateLastLoginin interface- User
- Throws:
- Exception- A generic exception.
 
- 
getUserDelegateDescription copied from interface:TurbineUserDelegateGet the delegated user- Specified by:
- getUserDelegatein interface- TurbineUserDelegate
- Returns:
- the userDelegate
 
- 
setUserDelegatepublic final void setUserDelegate(org.apache.fulcrum.security.model.turbine.entity.TurbineUser userDelegate) Description copied from interface:TurbineUserDelegateSet the delegated user- Specified by:
- setUserDelegatein interface- TurbineUserDelegate
- Parameters:
- userDelegate- the userDelegate to set
 
 
-