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 void
addPreviousEncodedPassword(String encodedPassword)
Add encoded password to previously passwords in encoded format.boolean
equals(Object o)
Date
getAccountCreationDate()
Get the Creation Date for this account.int
getCountFailedLoginAttempts()
Get Count of Failed Login Attempts.String
getEmail()
Gets the email address for this user.String
getEncodedPassword()
Gets the Encoded Password.String
getFullName()
Gets the Full Name for this user.Date
getLastLoginDate()
Get the Last Successful Login Date for this account.Date
getLastPasswordChange()
Gets the Date of the Last Password Change.String
getPassword()
Gets the Raw (unencoded) Password.List<String>
getPreviousEncodedPasswords()
Gets the list of previous password (in encoded format).String
getUserManagerId()
as we can user multiple userManagers implementation we must track from which one this one comes.String
getUsername()
Gets the User Name for this user.int
hashCode()
boolean
isLocked()
Determines if this user account is locked from use or not.boolean
isPasswordChangeRequired()
Determines if this user account must change their password on next login.boolean
isPermanent()
Gets the flag indicating if this user is a permanent user or not.boolean
isValidated()
Gets the flag indicating if this user has been validated (or not)void
setAccountCreationDate(Date date)
Set the Creation Date for this account.void
setCountFailedLoginAttempts(int count)
Set the count of failed login attempts.void
setEmail(String address)
Sets the email address for this user.void
setEncodedPassword(String encodedPassword)
Sets the Encoded Password.void
setFullName(String name)
Sets the Full Name for this user.void
setLastLoginDate(Date date)
Sets the Last Successful Login Date for this account.void
setLastPasswordChange(Date passwordChangeDate)
Sets the Last Password Change Date.void
setLocked(boolean locked)
Sets the locked state of this account.void
setPassword(String rawPassword)
Sets the raw (unencoded) password for this user.void
setPasswordChangeRequired(boolean changeRequired)
Sets the flag to indicate if this user must change their password on next login.void
setPermanent(boolean permanent)
Sets the permanent flag for this user.void
setPreviousEncodedPasswords(List<String> encodedPasswordList)
Sets the list of previous passwords (in encoded format)void
setUsername(String name)
Sets the User Name for this user.void
setValidated(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:User
Gets the User Name for this user. This field is required, and should never be empty.- Specified by:
getUsername
in interfaceUser
- Returns:
- the user name.
-
setUsername
public void setUsername(String name)
Description copied from interface:User
Sets the User Name for this user. This field is required, and should never be empty.- Specified by:
setUsername
in interfaceUser
- Parameters:
name
- the user name.
-
getFullName
public String getFullName()
Description copied from interface:User
Gets the Full Name for this user. This field is required, and should never be empty.- Specified by:
getFullName
in interfaceUser
- Returns:
- the full name.
-
setFullName
public void setFullName(String name)
Description copied from interface:User
Sets the Full Name for this user. This field is required, and should never be empty.- Specified by:
setFullName
in interfaceUser
- Parameters:
name
- the full name.
-
getEmail
public String getEmail()
Description copied from interface:User
Gets 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:User
Sets the email address for this user. This field is required, and should never be empty.
-
getPassword
public String getPassword()
Description copied from interface:User
Gets 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:
getPassword
in interfaceUser
- Returns:
- the raw encoded password.
-
setPassword
public void setPassword(String rawPassword)
Description copied from interface:User
Sets the raw (unencoded) password for this user.- Specified by:
setPassword
in interfaceUser
- Parameters:
rawPassword
- the raw unencoded password for this user.- See Also:
User.getPassword()
-
getEncodedPassword
public String getEncodedPassword()
Description copied from interface:User
Gets the Encoded Password.- Specified by:
getEncodedPassword
in interfaceUser
- Returns:
- the encoded password.
-
setEncodedPassword
public void setEncodedPassword(String encodedPassword)
Description copied from interface:User
Sets the Encoded Password. This field is populated by theUserManager
process.- Specified by:
setEncodedPassword
in interfaceUser
-
getLastPasswordChange
public Date getLastPasswordChange()
Description copied from interface:User
Gets the Date of the Last Password Change. Used by password management policies to enforce password expiration rules.- Specified by:
getLastPasswordChange
in interfaceUser
- Returns:
- the date of the last password change.
-
setLastPasswordChange
public void setLastPasswordChange(Date passwordChangeDate)
Description copied from interface:User
Sets the Last Password Change Date. This field is populated by theUserManager
process.- Specified by:
setLastPasswordChange
in interfaceUser
- Parameters:
passwordChangeDate
- the date that the last password change occured.
-
getPreviousEncodedPasswords
public List<String> getPreviousEncodedPasswords()
Description copied from interface:User
Gets the list of previous password (in encoded format). Used by password management policies to enforce password reuse rules.- Specified by:
getPreviousEncodedPasswords
in interfaceUser
- Returns:
- the list of
String
objects. Represents previous passwords (in encoded format).
-
setPreviousEncodedPasswords
public void setPreviousEncodedPasswords(List<String> encodedPasswordList)
Description copied from interface:User
Sets the list of previous passwords (in encoded format)- Specified by:
setPreviousEncodedPasswords
in interfaceUser
- Parameters:
encodedPasswordList
- (list ofString
objects.) the previously passwords in encoded format.
-
addPreviousEncodedPassword
public void addPreviousEncodedPassword(String encodedPassword)
Description copied from interface:User
Add encoded password to previously passwords in encoded format.- Specified by:
addPreviousEncodedPassword
in interfaceUser
- Parameters:
encodedPassword
- the encoded password to add.
-
isPermanent
public boolean isPermanent()
Description copied from interface:User
Gets the flag indicating if this user is a permanent user or not. Usually Root / Admin / Guest users are flagged as such.- Specified by:
isPermanent
in interfaceUser
-
setPermanent
public void setPermanent(boolean permanent)
Description copied from interface:User
Sets the permanent flag for this user. Users such as Root / Admin / Guest are typically flagged as permanent.- Specified by:
setPermanent
in interfaceUser
- Parameters:
permanent
- true if permanent.
-
isLocked
public boolean isLocked()
Description copied from interface:User
Determines 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:User
Sets the locked state of this account.
-
isPasswordChangeRequired
public boolean isPasswordChangeRequired()
Description copied from interface:User
Determines if this user account must change their password on next login.- Specified by:
isPasswordChangeRequired
in interfaceUser
- Returns:
- true if user must change password on next login.
-
setPasswordChangeRequired
public void setPasswordChangeRequired(boolean changeRequired)
Description copied from interface:User
Sets the flag to indicate if this user must change their password on next login.- Specified by:
setPasswordChangeRequired
in interfaceUser
- Parameters:
changeRequired
- true if user must change password on next login.
-
isValidated
public boolean isValidated()
Description copied from interface:User
Gets the flag indicating if this user has been validated (or not)- Specified by:
isValidated
in interfaceUser
- Returns:
- true if validated.
-
setValidated
public void setValidated(boolean valid)
Description copied from interface:User
Sets the flag indicating if this user has been validated (or not)- Specified by:
setValidated
in interfaceUser
- Parameters:
valid
- true if validated.
-
getCountFailedLoginAttempts
public int getCountFailedLoginAttempts()
Description copied from interface:User
Get Count of Failed Login Attempts.- Specified by:
getCountFailedLoginAttempts
in interfaceUser
- Returns:
- the count of failed login attempts.
-
setCountFailedLoginAttempts
public void setCountFailedLoginAttempts(int count)
Description copied from interface:User
Set the count of failed login attempts.- Specified by:
setCountFailedLoginAttempts
in interfaceUser
- Parameters:
count
- the count of failed login attempts.
-
getAccountCreationDate
public Date getAccountCreationDate()
Description copied from interface:User
Get the Creation Date for this account.- Specified by:
getAccountCreationDate
in interfaceUser
- Returns:
- the date of creation for this account.
-
setAccountCreationDate
public void setAccountCreationDate(Date date)
Description copied from interface:User
Set the Creation Date for this account.- Specified by:
setAccountCreationDate
in interfaceUser
-
getLastLoginDate
public Date getLastLoginDate()
Description copied from interface:User
Get the Last Successful Login Date for this account.- Specified by:
getLastLoginDate
in interfaceUser
- Returns:
- the date of the last successful login
-
setLastLoginDate
public void setLastLoginDate(Date date)
Description copied from interface:User
Sets the Last Successful Login Date for this account.- Specified by:
setLastLoginDate
in interfaceUser
-
getUserManagerId
public String getUserManagerId()
Description copied from interface:User
as we can user multiple userManagers implementation we must track from which one this one comes.- Specified by:
getUserManagerId
in interfaceUser
- Returns:
- userManager id
-
-