Class User

java.lang.Object
africa.absa.inception.security.User
All Implemented Interfaces:
Serializable

@Entity public class User extends Object implements Serializable
The User class holds the information for a user.
Author:
Marcus Portmann
See Also:
  • Constructor Details

    • User

      public User()
      Constructs a new User.
  • Method Details

    • equals

      public boolean equals(Object object)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      object - the reference object with which to compare
      Returns:
      true if this object is the same as the object argument otherwise false
    • getCreated

      public LocalDateTime getCreated()
      Returns the date and time the user was created.
      Returns:
      the date and time the user was created
    • getEmail

      public String getEmail()
      Returns the e-mail address for the user.
      Returns:
      the e-mail address for the user
    • getGroups

      public Set<Group> getGroups()
      Returns the groups the user is associated with.
      Returns:
      the groups the user is associated with
    • getId

      public UUID getId()
      Returns the ID for the user.
      Returns:
      the ID for the user
    • getMobileNumber

      public String getMobileNumber()
      Returns the international format mobile number for the user.
      Returns:
      the international format mobile number for the user
    • getName

      public String getName()
      Returns the name of the user.
      Returns:
      the name of the user
    • getPassword

      public String getPassword()
      Returns the password or password hash for the user.
      Returns:
      the password or password hash for the user
    • getPasswordAttempts

      public Integer getPasswordAttempts()
      Returns the number of failed authentication attempts as a result of an incorrect password for the user.
      Returns:
      the number of failed authentication attempts as a result of an incorrect password for the user
    • getPasswordExpiry

      public LocalDateTime getPasswordExpiry()
      Returns the date and time the password for the user expires.
      Returns:
      the date and time the password for the user expires
    • getPhoneNumber

      public String getPhoneNumber()
      Returns the phone number for the user.
      Returns:
      the phone number for the user
    • getPreferredName

      public String getPreferredName()
      Returns the preferred name for the user.
      Returns:
      the preferred name for the user
    • getStatus

      public UserStatus getStatus()
      Returns the status for the user.
      Returns:
      the status for the user
    • getUpdated

      public LocalDateTime getUpdated()
      Returns the date and time the user was last updated.
      Returns:
      the date and time the user was last updated
    • getUserDirectoryId

      public UUID getUserDirectoryId()
      Returns the ID for the user directory the user is associated with.
      Returns:
      the ID for the user directory the user is associated with
    • getUsername

      public String getUsername()
      Returns the username for the user.
      Returns:
      the username for the user
    • hasPasswordExpired

      public boolean hasPasswordExpired()
      Has the password for the user expired?
      Returns:
      true if the password for the user has expired or false otherwise
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for the object
    • isActive

      public boolean isActive()
      Is the user active?
      Returns:
      true if the user is active or false otherwise
    • isExpired

      public boolean isExpired()
      Is the user expired?
      Returns:
      true if the user is expired or false otherwise
    • isLocked

      public boolean isLocked()
      Is the user locked?
      Returns:
      true if the user is locked or false otherwise
    • setEmail

      public void setEmail(String email)
      Set the e-mail address for the user.
      Parameters:
      email - the e-mail address for the user
    • setGroups

      public void setGroups(Set<Group> groups)
      Set the groups the user is associated with.
      Parameters:
      groups - the groups the user is associated with
    • setId

      public void setId(UUID id)
      Set the ID for the user.
      Parameters:
      id - the ID for the user
    • setMobileNumber

      public void setMobileNumber(String mobileNumber)
      Set the international format mobile number for the user.
      Parameters:
      mobileNumber - the international format mobile number for the user
    • setName

      public void setName(String name)
      Set the name of the user.
      Parameters:
      name - the name of the user
    • setPassword

      public void setPassword(String password)
      Set the password or password hash for the user.
      Parameters:
      password - the password or password hash for the user
    • setPasswordAttempts

      public void setPasswordAttempts(int passwordAttempts)
      Set the password attempts for the user.
      Parameters:
      passwordAttempts - the password attempts for the user
    • setPasswordExpiry

      public void setPasswordExpiry(LocalDateTime passwordExpiry)
      Set the date and time the password for the user expires.
      Parameters:
      passwordExpiry - the date and time the password for the user expires
    • setPhoneNumber

      public void setPhoneNumber(String phoneNumber)
      Set the phone number for the user.
      Parameters:
      phoneNumber - the phone number for the user
    • setPreferredName

      public void setPreferredName(String preferredName)
      Set the preferred name for the user.
      Parameters:
      preferredName - the preferred name for the user
    • setStatus

      public void setStatus(UserStatus status)
      Set the status for the user.
      Parameters:
      status - the status for the user
    • setUserDirectoryId

      public void setUserDirectoryId(UUID userDirectoryId)
      Set the ID for the user directory the user is associated with.
      Parameters:
      userDirectoryId - the ID for the user directory the user is associated with
    • setUsername

      public void setUsername(String username)
      Set the username for the user.
      Parameters:
      username - the username for the user
    • onCreate

      protected void onCreate()
      The Java Persistence callback method invoked before the entity is created in the database.
    • onUpdate

      protected void onUpdate()
      The Java Persistence callback method invoked before the entity is updated in the database.