Package org.ldaptive

Class AbstractRetryMetadata

    • Field Detail

      • successTime

        protected Instant successTime
        Time at which the last success occurred.
      • failureTime

        protected Instant failureTime
        Time at which the failure occurred.
      • createTime

        private final Instant createTime
        Time at which this metadata was created.
    • Constructor Detail

      • AbstractRetryMetadata

        public AbstractRetryMetadata()
        Creates a new abstract retry metadata.
      • AbstractRetryMetadata

        protected AbstractRetryMetadata​(Clock clock)
        Creates a new abstract retry metadata.
        Parameters:
        clock - to set the create time
    • Method Detail

      • 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 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 interface RetryMetadata
        Parameters:
        time - Point in time when connection failed.