Class RecentLoginHistoryAttempt

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JSONObject asJSONObject()
      Retrieves a JSON object with an encoded representation of this recent login history attempt.
      int compareTo​(RecentLoginHistoryAttempt a)
      Retrieves an integer value that indicates the order of the provided recent login history attempt relative to this attempt in a sorted list.
      boolean equals​(java.lang.Object o)
      Indicates whether the provided object is logically equivalent to this recent login history attempt object.
      java.lang.Long 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.
      java.lang.String getAuthenticationMethod()
      Retrieves the name of the authentication method that the client used.
      java.lang.String getClientIPAddress()
      Retrieves the IP address of the client that made the authentication attempt, if available.
      java.lang.String getFailureReason()
      Retrieves a general reason that the authentication attempt failed, if appropriate.
      java.util.Date getTimestamp()
      Retrieves the time that the authentication attempt occurred.
      int hashCode()
      Retrieves a hash code for this recent login history attempt.
      boolean isSuccessful()
      Indicates whether this recent login history attempt is for a successful login.
      java.lang.String toString()
      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 Detail

      • RecentLoginHistoryAttempt

        public RecentLoginHistoryAttempt​(boolean successful,
                                         long timestamp,
                                         @NotNull
                                         java.lang.String authenticationMethod,
                                         @Nullable
                                         java.lang.String clientIPAddress,
                                         @Nullable
                                         java.lang.String failureReason,
                                         @Nullable
                                         java.lang.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

        public RecentLoginHistoryAttempt​(@NotNull
                                         JSONObject jsonObject)
                                  throws LDAPException
        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 Detail

      • 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

        @NotNull
        public java.util.Date getTimestamp()
        Retrieves the time that the authentication attempt occurred.
        Returns:
        The time that the authentication attempt occurred.
      • getAuthenticationMethod

        @NotNull
        public java.lang.String 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

        @Nullable
        public java.lang.String 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

        @Nullable
        public java.lang.String 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

        @Nullable
        public java.lang.Long 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

        @NotNull
        public JSONObject 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
                              java.lang.Object o)
        Indicates whether the provided object is logically equivalent to this recent login history attempt object.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        Returns:
        A hash code for this recent login history attempt.
      • compareTo

        public int compareTo​(@NotNull
                             RecentLoginHistoryAttempt a)
        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 java.lang.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

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of this recent login history attempt.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this recent login history attempt.