Class SimpleAuthenticationInfo

  • All Implemented Interfaces:
    AuthenticationInfo, java.io.Serializable

    public class SimpleAuthenticationInfo
    extends java.lang.Object
    implements AuthenticationInfo
    A simple implementation of the AuthenticationInfo interface.
    Since:
    1.5.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleAuthenticationInfo()
      Default no-argument constructor.
      SimpleAuthenticationInfo​(java.lang.String username, boolean locked, java.time.LocalDateTime creationDate, java.time.LocalDateTime passwordExpirationDate, boolean hasPasswordExpiration)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      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.lang.String getUsername()
      Returns the username.
      int hashCode()  
      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.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimpleAuthenticationInfo

        public SimpleAuthenticationInfo()
        Default no-argument constructor.
      • SimpleAuthenticationInfo

        public SimpleAuthenticationInfo​(java.lang.String username,
                                        boolean locked,
                                        java.time.LocalDateTime creationDate,
                                        java.time.LocalDateTime passwordExpirationDate,
                                        boolean hasPasswordExpiration)
    • Method Detail

      • getUsername

        public java.lang.String getUsername()
        Returns the username.
        Specified by:
        getUsername in interface AuthenticationInfo
        Returns:
        the username
      • 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
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object