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 Details

    • 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.
  • Constructor Details

    • AbstractRetryMetadata

      public AbstractRetryMetadata()
  • Method Details

    • getSuccessTime

      public Instant getSuccessTime()
      Description copied from interface: RetryMetadata
      Returns the success time.
      Specified by:
      getSuccessTime in interface RetryMetadata
      Returns:
      time that the success occurred
    • getFailureTime

      public Instant getFailureTime()
      Description copied from interface: RetryMetadata
      Returns the failure time.
      Specified by:
      getFailureTime in interface RetryMetadata
      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 interface RetryMetadata
      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 interface RetryMetadata
      Parameters:
      time - Point in time where 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 interface RetryMetadata
      Parameters:
      time - Point in time where connection failed.
    • toString

      public String toString()
      Overrides:
      toString in class Object