Package org.ldaptive
Class AbstractRetryMetadata
java.lang.Object
org.ldaptive.AbstractRetryMetadata
- All Implemented Interfaces:
RetryMetadata
- Direct Known Subclasses:
ClosedRetryMetadata
,InitialRetryMetadata
,LdapURLRetryMetadata
Common implementation of retry metadata.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicInteger
Attempt count.protected Instant
Time at which the failure occurred.protected Instant
Time at which the last success occurred. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Number of attempts for this retry.Returns the failure time.Returns the success time.void
recordFailure
(Instant time) Records a connection failure at the given instant.void
recordSuccess
(Instant time) Records a connection success at the given instant.toString()
-
Field Details
-
successTime
Time at which the last success occurred. -
failureTime
Time at which the failure occurred. -
attempts
Attempt count.
-
-
Constructor Details
-
AbstractRetryMetadata
public AbstractRetryMetadata()
-
-
Method Details
-
getSuccessTime
Description copied from interface:RetryMetadata
Returns the success time.- Specified by:
getSuccessTime
in interfaceRetryMetadata
- Returns:
- time that the success occurred
-
getFailureTime
Description copied from interface:RetryMetadata
Returns the failure time.- Specified by:
getFailureTime
in interfaceRetryMetadata
- Returns:
- time that the failure occurred
-
getAttempts
public int getAttempts()Description copied from interface:RetryMetadata
Number of attempts for this retry.- Specified by:
getAttempts
in interfaceRetryMetadata
- Returns:
- retry attempts
-
recordSuccess
Description copied from interface:RetryMetadata
Records a connection success at the given instant.- Specified by:
recordSuccess
in interfaceRetryMetadata
- Parameters:
time
- Point in time where connection was opened.
-
recordFailure
Description copied from interface:RetryMetadata
Records a connection failure at the given instant.- Specified by:
recordFailure
in interfaceRetryMetadata
- Parameters:
time
- Point in time where connection failed.
-
toString
-