@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class RecentLoginHistoryAttempt extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<RecentLoginHistoryAttempt>
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.
Constructor and 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.
|
Modifier and Type | Method and 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.
|
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)
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).public RecentLoginHistoryAttempt(@NotNull JSONObject jsonObject) throws LDAPException
jsonObject
- A JSON object containing an encoded representation of
the attempt. It must not be null
.LDAPException
- If a problem occurs while attempting to decode the
provided JSON object as a recent login history
attempt.public boolean isSuccessful()
true
if this recent login history attempt is for a
successful login, or false
if it is for a failed login.@NotNull public java.util.Date getTimestamp()
@NotNull public java.lang.String getAuthenticationMethod()
@Nullable public java.lang.String getClientIPAddress()
null
if no client IP address is available (e.g.,
because the client authenticated through some internal mechanism).@Nullable public java.lang.String getFailureReason()
null
if the attempt was successful.@Nullable public java.lang.Long getAdditionalAttemptCount()
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).@NotNull public JSONObject asJSONObject()
public boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
o
- The object for which to make the determination.true
if the provided object is logically equivalent to
this recent login history attempt object, or false
if not.public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(@NotNull RecentLoginHistoryAttempt a)
compareTo
in interface java.lang.Comparable<RecentLoginHistoryAttempt>
a
- The recent login history attempt to compare to this attempt. It
must not be null
.