Class JpaUser
- java.lang.Object
-
- org.apache.archiva.redback.users.jpa.model.JpaUser
-
- All Implemented Interfaces:
Serializable,User
@Entity public class JpaUser extends Object implements User
Created by martin on 20.09.16.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JpaUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPreviousEncodedPassword(String encodedPassword)Add encoded password to previously passwords in encoded format.booleanequals(Object o)DategetAccountCreationDate()Get the Creation Date for this account.intgetCountFailedLoginAttempts()Get Count of Failed Login Attempts.StringgetEmail()Gets the email address for this user.StringgetEncodedPassword()Gets the Encoded Password.StringgetFullName()Gets the Full Name for this user.DategetLastLoginDate()Get the Last Successful Login Date for this account.DategetLastPasswordChange()Gets the Date of the Last Password Change.StringgetPassword()Gets the Raw (unencoded) Password.List<String>getPreviousEncodedPasswords()Gets the list of previous password (in encoded format).StringgetUserManagerId()as we can user multiple userManagers implementation we must track from which one this one comes.StringgetUsername()Gets the User Name for this user.inthashCode()booleanisLocked()Determines if this user account is locked from use or not.booleanisPasswordChangeRequired()Determines if this user account must change their password on next login.booleanisPermanent()Gets the flag indicating if this user is a permanent user or not.booleanisValidated()Gets the flag indicating if this user has been validated (or not)voidsetAccountCreationDate(Date date)Set the Creation Date for this account.voidsetCountFailedLoginAttempts(int count)Set the count of failed login attempts.voidsetEmail(String address)Sets the email address for this user.voidsetEncodedPassword(String encodedPassword)Sets the Encoded Password.voidsetFullName(String name)Sets the Full Name for this user.voidsetLastLoginDate(Date date)Sets the Last Successful Login Date for this account.voidsetLastPasswordChange(Date passwordChangeDate)Sets the Last Password Change Date.voidsetLocked(boolean locked)Sets the locked state of this account.voidsetPassword(String rawPassword)Sets the raw (unencoded) password for this user.voidsetPasswordChangeRequired(boolean changeRequired)Sets the flag to indicate if this user must change their password on next login.voidsetPermanent(boolean permanent)Sets the permanent flag for this user.voidsetPreviousEncodedPasswords(List<String> encodedPasswordList)Sets the list of previous passwords (in encoded format)voidsetUsername(String name)Sets the User Name for this user.voidsetValidated(boolean valid)Sets the flag indicating if this user has been validated (or not)
-
-
-
Constructor Detail
-
JpaUser
public JpaUser()
-
-
Method Detail
-
getUsername
public String getUsername()
Description copied from interface:UserGets the User Name for this user. This field is required, and should never be empty.- Specified by:
getUsernamein interfaceUser- Returns:
- the user name.
-
setUsername
public void setUsername(String name)
Description copied from interface:UserSets the User Name for this user. This field is required, and should never be empty.- Specified by:
setUsernamein interfaceUser- Parameters:
name- the user name.
-
getFullName
public String getFullName()
Description copied from interface:UserGets the Full Name for this user. This field is required, and should never be empty.- Specified by:
getFullNamein interfaceUser- Returns:
- the full name.
-
setFullName
public void setFullName(String name)
Description copied from interface:UserSets the Full Name for this user. This field is required, and should never be empty.- Specified by:
setFullNamein interfaceUser- Parameters:
name- the full name.
-
getEmail
public String getEmail()
Description copied from interface:UserGets the email address for this user. This field is required, and should never be empty.
-
setEmail
public void setEmail(String address)
Description copied from interface:UserSets the email address for this user. This field is required, and should never be empty.
-
getPassword
public String getPassword()
Description copied from interface:UserGets the Raw (unencoded) Password. Used only on password change requests.Notes for User Providers
- Providers need to look for a value in here to indicate if the user is intending to change their password.
- The providers of this interface need to use this field, encode the password, place it's value into the encodedPassword field, and clear out the raw unencoded password field.
- This field should never be stored on disk.
- Specified by:
getPasswordin interfaceUser- Returns:
- the raw encoded password.
-
setPassword
public void setPassword(String rawPassword)
Description copied from interface:UserSets the raw (unencoded) password for this user.- Specified by:
setPasswordin interfaceUser- Parameters:
rawPassword- the raw unencoded password for this user.- See Also:
User.getPassword()
-
getEncodedPassword
public String getEncodedPassword()
Description copied from interface:UserGets the Encoded Password.- Specified by:
getEncodedPasswordin interfaceUser- Returns:
- the encoded password.
-
setEncodedPassword
public void setEncodedPassword(String encodedPassword)
Description copied from interface:UserSets the Encoded Password. This field is populated by theUserManagerprocess.- Specified by:
setEncodedPasswordin interfaceUser
-
getLastPasswordChange
public Date getLastPasswordChange()
Description copied from interface:UserGets the Date of the Last Password Change. Used by password management policies to enforce password expiration rules.- Specified by:
getLastPasswordChangein interfaceUser- Returns:
- the date of the last password change.
-
setLastPasswordChange
public void setLastPasswordChange(Date passwordChangeDate)
Description copied from interface:UserSets the Last Password Change Date. This field is populated by theUserManagerprocess.- Specified by:
setLastPasswordChangein interfaceUser- Parameters:
passwordChangeDate- the date that the last password change occured.
-
getPreviousEncodedPasswords
public List<String> getPreviousEncodedPasswords()
Description copied from interface:UserGets the list of previous password (in encoded format). Used by password management policies to enforce password reuse rules.- Specified by:
getPreviousEncodedPasswordsin interfaceUser- Returns:
- the list of
Stringobjects. Represents previous passwords (in encoded format).
-
setPreviousEncodedPasswords
public void setPreviousEncodedPasswords(List<String> encodedPasswordList)
Description copied from interface:UserSets the list of previous passwords (in encoded format)- Specified by:
setPreviousEncodedPasswordsin interfaceUser- Parameters:
encodedPasswordList- (list ofStringobjects.) the previously passwords in encoded format.
-
addPreviousEncodedPassword
public void addPreviousEncodedPassword(String encodedPassword)
Description copied from interface:UserAdd encoded password to previously passwords in encoded format.- Specified by:
addPreviousEncodedPasswordin interfaceUser- Parameters:
encodedPassword- the encoded password to add.
-
isPermanent
public boolean isPermanent()
Description copied from interface:UserGets the flag indicating if this user is a permanent user or not. Usually Root / Admin / Guest users are flagged as such.- Specified by:
isPermanentin interfaceUser
-
setPermanent
public void setPermanent(boolean permanent)
Description copied from interface:UserSets the permanent flag for this user. Users such as Root / Admin / Guest are typically flagged as permanent.- Specified by:
setPermanentin interfaceUser- Parameters:
permanent- true if permanent.
-
isLocked
public boolean isLocked()
Description copied from interface:UserDetermines if this user account is locked from use or not. This state is set from an administrative point of view, or due to excessive failed login attempts.
-
setLocked
public void setLocked(boolean locked)
Description copied from interface:UserSets the locked state of this account.
-
isPasswordChangeRequired
public boolean isPasswordChangeRequired()
Description copied from interface:UserDetermines if this user account must change their password on next login.- Specified by:
isPasswordChangeRequiredin interfaceUser- Returns:
- true if user must change password on next login.
-
setPasswordChangeRequired
public void setPasswordChangeRequired(boolean changeRequired)
Description copied from interface:UserSets the flag to indicate if this user must change their password on next login.- Specified by:
setPasswordChangeRequiredin interfaceUser- Parameters:
changeRequired- true if user must change password on next login.
-
isValidated
public boolean isValidated()
Description copied from interface:UserGets the flag indicating if this user has been validated (or not)- Specified by:
isValidatedin interfaceUser- Returns:
- true if validated.
-
setValidated
public void setValidated(boolean valid)
Description copied from interface:UserSets the flag indicating if this user has been validated (or not)- Specified by:
setValidatedin interfaceUser- Parameters:
valid- true if validated.
-
getCountFailedLoginAttempts
public int getCountFailedLoginAttempts()
Description copied from interface:UserGet Count of Failed Login Attempts.- Specified by:
getCountFailedLoginAttemptsin interfaceUser- Returns:
- the count of failed login attempts.
-
setCountFailedLoginAttempts
public void setCountFailedLoginAttempts(int count)
Description copied from interface:UserSet the count of failed login attempts.- Specified by:
setCountFailedLoginAttemptsin interfaceUser- Parameters:
count- the count of failed login attempts.
-
getAccountCreationDate
public Date getAccountCreationDate()
Description copied from interface:UserGet the Creation Date for this account.- Specified by:
getAccountCreationDatein interfaceUser- Returns:
- the date of creation for this account.
-
setAccountCreationDate
public void setAccountCreationDate(Date date)
Description copied from interface:UserSet the Creation Date for this account.- Specified by:
setAccountCreationDatein interfaceUser
-
getLastLoginDate
public Date getLastLoginDate()
Description copied from interface:UserGet the Last Successful Login Date for this account.- Specified by:
getLastLoginDatein interfaceUser- Returns:
- the date of the last successful login
-
setLastLoginDate
public void setLastLoginDate(Date date)
Description copied from interface:UserSets the Last Successful Login Date for this account.- Specified by:
setLastLoginDatein interfaceUser
-
getUserManagerId
public String getUserManagerId()
Description copied from interface:Useras we can user multiple userManagers implementation we must track from which one this one comes.- Specified by:
getUserManagerIdin interfaceUser- Returns:
- userManager id
-
-