Class RecentLoginHistoryAttempt

java.lang.Object
com.unboundid.ldap.sdk.unboundidds.controls.RecentLoginHistoryAttempt
All Implemented Interfaces:
Serializable, Comparable<RecentLoginHistoryAttempt>

This class provides a data structure with information about a recent login attempt for a user.
NOTE: This class, and other classes within the com.unboundid.ldap.sdk.unboundidds package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    RecentLoginHistoryAttempt(boolean successful, long timestamp, String authenticationMethod, String clientIPAddress, String failureReason, Long additionalAttemptCount)
    Creates a new recent login history attempt object with the provided information.
    Creates a new recent login history attempt object that is decoded from the provided JSON object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves a JSON object with an encoded representation of this recent login history attempt.
    int
    Retrieves an integer value that indicates the order of the provided recent login history attempt relative to this attempt in a sorted list.
    boolean
    Indicates whether the provided object is logically equivalent to this recent login history attempt object.
    Retrieves the number of additional authentication attempts that occurred on the same date (in the UTC time zone) as the timestamp for this attempt and had the same values for the successful, authentication method, client IP address, and failure reason fields.
    Retrieves the name of the authentication method that the client used.
    Retrieves the IP address of the client that made the authentication attempt, if available.
    Retrieves a general reason that the authentication attempt failed, if appropriate.
    Retrieves the time that the authentication attempt occurred.
    int
    Retrieves a hash code for this recent login history attempt.
    boolean
    Indicates whether this recent login history attempt is for a successful login.
    Retrieves a string representation of this recent login history attempt.

    Methods inherited from class java.lang.Object

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

    • RecentLoginHistoryAttempt

      public RecentLoginHistoryAttempt(boolean successful, long timestamp, @NotNull String authenticationMethod, @Nullable String clientIPAddress, @Nullable String failureReason, @Nullable Long additionalAttemptCount)
      Creates a new recent login history attempt object with the provided information.
      Parameters:
      successful - Indicates whether the attempt was successful.
      timestamp - The time of the authentication attempt.
      authenticationMethod - The name of the authentication method used for the attempt. This must not be null or empty.
      clientIPAddress - The IP address of the client that made the authentication attempt. This may be null if no client IP address is available.
      failureReason - A general reason that the authentication attempt failed. It must be null if the attempt succeeded and must not be null if the attempt failed. If provided, the value should be one of the FAILURE_NAME_* constants in the AuthenticationFailureReason class.
      additionalAttemptCount - The number of additional authentication attempts that occurred on the same date (in the UTC time zone) as the provided timestamp with the same values for the successful, authentication method, client IP address, and failure reason fields. It may be null if this should not be included (e.g., if information about similar attempts should not be collapsed).
    • RecentLoginHistoryAttempt

      Creates a new recent login history attempt object that is decoded from the provided JSON object.
      Parameters:
      jsonObject - A JSON object containing an encoded representation of the attempt. It must not be null.
      Throws:
      LDAPException - If a problem occurs while attempting to decode the provided JSON object as a recent login history attempt.
  • Method Details

    • isSuccessful

      public boolean isSuccessful()
      Indicates whether this recent login history attempt is for a successful login.
      Returns:
      true if this recent login history attempt is for a successful login, or false if it is for a failed login.
    • getTimestamp

      Retrieves the time that the authentication attempt occurred.
      Returns:
      The time that the authentication attempt occurred.
    • getAuthenticationMethod

      Retrieves the name of the authentication method that the client used. The value should generally be one of "simple" (for LDAP simple authentication), "internal" (if the authentication occurred internally within the server), or "SASL {mechanism}" (if the client authenticated via some SASL mechanism).
      Returns:
      The name of the authentication method that the client used.
    • getClientIPAddress

      Retrieves the IP address of the client that made the authentication attempt, if available.
      Returns:
      The IP address of the client that made the authentication attempt, or null if no client IP address is available (e.g., because the client authenticated through some internal mechanism).
    • getFailureReason

      Retrieves a general reason that the authentication attempt failed, if appropriate.
      Returns:
      A general reason that the authentication attempt failed, or null if the attempt was successful.
    • getAdditionalAttemptCount

      Retrieves the number of additional authentication attempts that occurred on the same date (in the UTC time zone) as the timestamp for this attempt and had the same values for the successful, authentication method, client IP address, and failure reason fields.
      Returns:
      The number of additional similar authentication attempts that occurred on the same date as this attempt, or null if this is not available (e.g., because the server is not configured to collapse information about multiple similar attempts into a single record).
    • asJSONObject

      Retrieves a JSON object with an encoded representation of this recent login history attempt.
      Returns:
      A JSON object with an encoded representation of this recent long history attempt.
    • equals

      public boolean equals(@Nullable Object o)
      Indicates whether the provided object is logically equivalent to this recent login history attempt object.
      Overrides:
      equals in class Object
      Parameters:
      o - The object for which to make the determination.
      Returns:
      true if the provided object is logically equivalent to this recent login history attempt object, or false if not.
    • hashCode

      public int hashCode()
      Retrieves a hash code for this recent login history attempt.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code for this recent login history attempt.
    • compareTo

      Retrieves an integer value that indicates the order of the provided recent login history attempt relative to this attempt in a sorted list.
      Specified by:
      compareTo in interface Comparable<RecentLoginHistoryAttempt>
      Parameters:
      a - The recent login history attempt to compare to this attempt. It must not be null.
      Returns:
      A negative value integer if this attempt should be ordered before the provided attempt in a sorted list, a positive integer if this attempt should be ordered after the provided attempt, or zero if they are logically equivalent.
    • toString

      Retrieves a string representation of this recent login history attempt.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this recent login history attempt.