Package org.ldaptive
Class AbstractRetryMetadata
- java.lang.Object
-
- org.ldaptive.AbstractRetryMetadata
-
- All Implemented Interfaces:
RetryMetadata
- Direct Known Subclasses:
ClosedRetryMetadata
,InitialRetryMetadata
,LdapURLRetryMetadata
public abstract class AbstractRetryMetadata extends Object implements RetryMetadata
Common implementation of retry metadata.
-
-
Field Summary
Fields Modifier and Type Field Description private AtomicInteger
attempts
Attempt count.protected Instant
failureTime
Time at which the failure occurred.protected Instant
successTime
Time at which the last success occurred.
-
Constructor Summary
Constructors Constructor Description AbstractRetryMetadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAttempts()
Number of attempts for this retry.Instant
getFailureTime()
Returns the failure time.Instant
getSuccessTime()
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.String
toString()
-
-
-
Field Detail
-
successTime
protected Instant successTime
Time at which the last success occurred.
-
failureTime
protected Instant failureTime
Time at which the failure occurred.
-
attempts
private final AtomicInteger attempts
Attempt count.
-
-
Method Detail
-
getSuccessTime
public Instant getSuccessTime()
Description copied from interface:RetryMetadata
Returns the success time.- Specified by:
getSuccessTime
in interfaceRetryMetadata
- Returns:
- time that the success occurred
-
getFailureTime
public Instant 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
public void recordSuccess(Instant time)
Description copied from interface:RetryMetadata
Records a connection success at the given instant.- Specified by:
recordSuccess
in interfaceRetryMetadata
- Parameters:
time
- Point in time when connection was opened.
-
recordFailure
public void recordFailure(Instant time)
Description copied from interface:RetryMetadata
Records a connection failure at the given instant.- Specified by:
recordFailure
in interfaceRetryMetadata
- Parameters:
time
- Point in time when connection failed.
-
-