Class UserAccount

    • Constructor Summary

      Constructors 
      Constructor Description
      UserAccount​(java.lang.String username, java.time.LocalDateTime creationDate, boolean locked, boolean hasPasswordExpiration, java.time.LocalDateTime passwordExpirationDate)
      Maps a user in the database to a object.
      UserAccount​(java.lang.String username, java.time.LocalDateTime creationDate, boolean locked, boolean hasPasswordExpiration, java.time.LocalDateTime passwordExpirationDate, java.util.Set<java.lang.String> roles)
      Maps a user in the database to a object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.time.LocalDateTime getCreationDate()
      Returns the date and time the Account was initially created.
      java.time.LocalDateTime getPasswordExpirationDate()
      Returns the expiration date of the current password.
      java.util.Collection<java.lang.String> getRoles()
      Returns the Account's assigned roles.
      java.lang.String getUsername()
      Returns the username.
      boolean hasPasswordExpiration()
      Returns true if a password expiration date is set.
      boolean isLocked()
      Returns true if this Account is locked and thus cannot be used to login.
      boolean isPasswordExpired()
      Returns whether or not the Account's password is expired.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UserAccount

        public UserAccount​(java.lang.String username,
                           java.time.LocalDateTime creationDate,
                           boolean locked,
                           boolean hasPasswordExpiration,
                           java.time.LocalDateTime passwordExpirationDate)
        Maps a user in the database to a object.
        Parameters:
        username - the username
        creationDate - the date and time that the user was created
        locked - if the account is locked
        hasPasswordExpiration - if the password is set to expire
        passwordExpirationDate - the date the password is set to expire
      • UserAccount

        public UserAccount​(java.lang.String username,
                           java.time.LocalDateTime creationDate,
                           boolean locked,
                           boolean hasPasswordExpiration,
                           java.time.LocalDateTime passwordExpirationDate,
                           java.util.Set<java.lang.String> roles)
        Maps a user in the database to a object.
        Parameters:
        username - the username
        creationDate - the date and time that the user was created
        locked - specifies if the account is locked
        hasPasswordExpiration - specifies if the password has an expiration date
        passwordExpirationDate - the password expiration date
        roles - the user roles to add
    • Method Detail

      • getUsername

        public java.lang.String getUsername()
        Returns the username.
        Specified by:
        getUsername in interface AuthenticationInfo
        Returns:
        the username
      • getRoles

        public java.util.Collection<java.lang.String> getRoles()
        Returns the Account's assigned roles.
        Specified by:
        getRoles in interface AuthorizationInfo
        Returns:
        the Account's assigned roles
      • isLocked

        public boolean isLocked()
        Returns true if this Account is locked and thus cannot be used to login.
        Specified by:
        isLocked in interface AuthenticationInfo
        Returns:
        true if this Account is locked and thus cannot be used to login
      • isPasswordExpired

        public boolean isPasswordExpired()
        Returns whether or not the Account's password is expired. This usually indicates that the password would need to changed before the account could be used.
        Specified by:
        isPasswordExpired in interface AuthenticationInfo
        Returns:
        whether or not the Account's credentials are expired
        Since:
        1.5.0 changed implementation
      • getCreationDate

        public java.time.LocalDateTime getCreationDate()
        Returns the date and time the Account was initially created.
        Specified by:
        getCreationDate in interface AuthenticationInfo
        Returns:
        the date and time the Account was initially created
        Since:
        1.5.0
      • getPasswordExpirationDate

        public java.time.LocalDateTime getPasswordExpirationDate()
        Returns the expiration date of the current password.
        Specified by:
        getPasswordExpirationDate in interface AuthenticationInfo
        Returns:
        the expiration date of the current password
        Since:
        1.5.0
      • hasPasswordExpiration

        public boolean hasPasswordExpiration()
        Returns true if a password expiration date is set.
        Specified by:
        hasPasswordExpiration in interface AuthenticationInfo
        Returns:
        true if a password expiration date is set.
        Since:
        1.5.0