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 AtomicIntegerAttempt count.private final InstantTime at which this metadata was created.protected InstantTime at which the failure occurred.protected InstantTime at which the last success occurred. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRetryMetadata(Clock clock) Creates a new abstract retry metadata. -
Method Summary
Modifier and TypeMethodDescriptionintNumber of attempts for this retry.Returns the create time.Returns the failure time.Returns the success time.voidrecordFailure(Instant time) Records a connection failure at the given instant.voidrecordSuccess(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. -
createTime
Time at which this metadata was created. -
attempts
Attempt count.
-
-
Constructor Details
-
AbstractRetryMetadata
Creates a new abstract retry metadata.- Parameters:
clock- to set the create time
-
-
Method Details
-
getSuccessTime
Description copied from interface:RetryMetadataReturns the success time.- Specified by:
getSuccessTimein interfaceRetryMetadata- Returns:
- time that the success occurred
-
getFailureTime
Description copied from interface:RetryMetadataReturns the failure time.- Specified by:
getFailureTimein interfaceRetryMetadata- Returns:
- time that the failure occurred
-
getCreateTime
Description copied from interface:RetryMetadataReturns the create time.- Specified by:
getCreateTimein interfaceRetryMetadata- Returns:
- time that the metadata was created
-
getAttempts
public int getAttempts()Description copied from interface:RetryMetadataNumber of attempts for this retry.- Specified by:
getAttemptsin interfaceRetryMetadata- Returns:
- retry attempts
-
recordSuccess
Description copied from interface:RetryMetadataRecords a connection success at the given instant.- Specified by:
recordSuccessin interfaceRetryMetadata- Parameters:
time- Point in time when connection was opened.
-
recordFailure
Description copied from interface:RetryMetadataRecords a connection failure at the given instant.- Specified by:
recordFailurein interfaceRetryMetadata- Parameters:
time- Point in time when connection failed.
-
toString
-