Class RecentLoginHistoryAttempt
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.controls.RecentLoginHistoryAttempt
- All Implemented Interfaces:
Serializable,Comparable<RecentLoginHistoryAttempt>
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class RecentLoginHistoryAttempt
extends Object
implements 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
ConstructorsConstructorDescriptionRecentLoginHistoryAttempt(boolean successful, long timestamp, String authenticationMethod, String clientIPAddress, String failureReason, 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
Modifier and TypeMethodDescriptionRetrieves a JSON object with an encoded representation of this recent login history attempt.intRetrieves an integer value that indicates the order of the provided recent login history attempt relative to this attempt in a sorted list.booleanIndicates 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.inthashCode()Retrieves a hash code for this recent login history attempt.booleanIndicates whether this recent login history attempt is for a successful login.toString()Retrieves a string representation of this recent login history attempt.
-
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 benullor empty.clientIPAddress- The IP address of the client that made the authentication attempt. This may benullif no client IP address is available.failureReason- A general reason that the authentication attempt failed. It must benullif the attempt succeeded and must not benullif the attempt failed. If provided, the value should be one of theFAILURE_NAME_* constants in theAuthenticationFailureReasonclass.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 benullif 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 benull.- Throws:
LDAPException- If a problem occurs while attempting to decode the provided JSON object as a recent login history attempt.
-
-
Method Details
-
isSuccessful
Indicates whether this recent login history attempt is for a successful login.- Returns:
trueif this recent login history attempt is for a successful login, orfalseif 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
nullif 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
nullif 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
nullif 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
Indicates whether the provided object is logically equivalent to this recent login history attempt object. -
hashCode
Retrieves 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:
compareToin interfaceComparable<RecentLoginHistoryAttempt>- Parameters:
a- The recent login history attempt to compare to this attempt. It must not benull.- 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.
-