Package org.apache.archiva.redback.users
Interface User
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
JpaUser
,LdapUser
,SimpleUser
public interface User extends Serializable
The User Object.- Author:
- Jason van Zyl, Joakim Erdfelt
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addPreviousEncodedPassword(String encodedPassword)
Add encoded password to previously passwords in encoded format.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.default String
getId()
This should return a global user id.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.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)
-
-
-
Method Detail
-
getId
default String getId()
This should return a global user id. Global user ids are builtMANAGER_ID:USER_IDENTIFIER
User identifier must not be the username but must be unique, e.g. for LDAP it may be the DN.- Returns:
-
getUsername
String getUsername()
Gets the User Name for this user. This field is required, and should never be empty.- Returns:
- the user name.
-
setUsername
void setUsername(String name)
Sets the User Name for this user. This field is required, and should never be empty.- Parameters:
name
- the user name.
-
getFullName
String getFullName()
Gets the Full Name for this user. This field is required, and should never be empty.- Returns:
- the full name.
-
setFullName
void setFullName(String name)
Sets the Full Name for this user. This field is required, and should never be empty.- Parameters:
name
- the full name.
-
getEmail
String getEmail()
Gets the email address for this user. This field is required, and should never be empty.- Returns:
- the email address.
-
setEmail
void setEmail(String address)
Sets the email address for this user. This field is required, and should never be empty.- Parameters:
address
- the email address.
-
getPassword
String getPassword()
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.
- Returns:
- the raw encoded password.
-
setPassword
void setPassword(String rawPassword)
Sets the raw (unencoded) password for this user.- Parameters:
rawPassword
- the raw unencoded password for this user.- See Also:
getPassword()
-
getEncodedPassword
String getEncodedPassword()
Gets the Encoded Password.- Returns:
- the encoded password.
-
setEncodedPassword
void setEncodedPassword(String encodedPassword)
Sets the Encoded Password. This field is populated by theUserManager
process.- Parameters:
encodedPassword
-
-
getLastPasswordChange
Date getLastPasswordChange()
Gets the Date of the Last Password Change. Used by password management policies to enforce password expiration rules.- Returns:
- the date of the last password change.
-
setLastPasswordChange
void setLastPasswordChange(Date passwordChangeDate)
Sets the Last Password Change Date. This field is populated by theUserManager
process.- Parameters:
passwordChangeDate
- the date that the last password change occured.
-
getPreviousEncodedPasswords
List<String> getPreviousEncodedPasswords()
Gets the list of previous password (in encoded format). Used by password management policies to enforce password reuse rules.- Returns:
- the list of
String
objects. Represents previous passwords (in encoded format).
-
setPreviousEncodedPasswords
void setPreviousEncodedPasswords(List<String> encodedPasswordList)
Sets the list of previous passwords (in encoded format)- Parameters:
encodedPasswordList
- (list ofString
objects.) the previously passwords in encoded format.
-
addPreviousEncodedPassword
void addPreviousEncodedPassword(String encodedPassword)
Add encoded password to previously passwords in encoded format.- Parameters:
encodedPassword
- the encoded password to add.
-
isPermanent
boolean isPermanent()
Gets the flag indicating if this user is a permanent user or not. Usually Root / Admin / Guest users are flagged as such.
-
setPermanent
void setPermanent(boolean permanent)
Sets the permanent flag for this user. Users such as Root / Admin / Guest are typically flagged as permanent.- Parameters:
permanent
- true if permanent.
-
isLocked
boolean isLocked()
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.- Returns:
- true if account is locked.
-
setLocked
void setLocked(boolean locked)
Sets the locked state of this account.- Parameters:
locked
- true if account is to be locked.
-
isPasswordChangeRequired
boolean isPasswordChangeRequired()
Determines if this user account must change their password on next login.- Returns:
- true if user must change password on next login.
-
setPasswordChangeRequired
void setPasswordChangeRequired(boolean changeRequired)
Sets the flag to indicate if this user must change their password on next login.- Parameters:
changeRequired
- true if user must change password on next login.
-
isValidated
boolean isValidated()
Gets the flag indicating if this user has been validated (or not)- Returns:
- true if validated.
-
setValidated
void setValidated(boolean valid)
Sets the flag indicating if this user has been validated (or not)- Parameters:
valid
- true if validated.
-
getCountFailedLoginAttempts
int getCountFailedLoginAttempts()
Get Count of Failed Login Attempts.- Returns:
- the count of failed login attempts.
-
setCountFailedLoginAttempts
void setCountFailedLoginAttempts(int count)
Set the count of failed login attempts.- Parameters:
count
- the count of failed login attempts.
-
getAccountCreationDate
Date getAccountCreationDate()
Get the Creation Date for this account.- Returns:
- the date of creation for this account.
-
setAccountCreationDate
void setAccountCreationDate(Date date)
Set the Creation Date for this account.
-
getLastLoginDate
Date getLastLoginDate()
Get the Last Successful Login Date for this account.- Returns:
- the date of the last successful login
-
setLastLoginDate
void setLastLoginDate(Date date)
Sets the Last Successful Login Date for this account.
-
getUserManagerId
String getUserManagerId()
as we can user multiple userManagers implementation we must track from which one this one comes.- Returns:
- userManager id
- Since:
- 2.1
-
-