Package org.ldaptive

Class AbstractConnectionValidator

    • Field Detail

      • DEFAULT_VALIDATE_PERIOD

        public static final Duration DEFAULT_VALIDATE_PERIOD
        Default validation period, value is 30 minutes.
      • DEFAULT_VALIDATE_TIMEOUT

        public static final Duration DEFAULT_VALIDATE_TIMEOUT
        Default per connection validate timeout, value is 5 seconds.
      • logger

        protected final Logger logger
        Logger for this class.
      • validatePeriod

        private Duration validatePeriod
        Validation period.
      • validateTimeout

        private Duration validateTimeout
        Maximum length of time a connection validation should block.
      • onSuccess

        private Consumer<Connection> onSuccess
        Consumer to execute on a successful validation.
      • onFailure

        private Consumer<Connection> onFailure
        Consumer to execute on a failed validation.
      • timeoutIsFailure

        private boolean timeoutIsFailure
        Whether the occurrence of a timeout should result in a validation failure.
    • Constructor Detail

      • AbstractConnectionValidator

        public AbstractConnectionValidator()
    • Method Detail

      • setValidatePeriod

        public void setValidatePeriod​(Duration period)
      • setValidateTimeout

        public void setValidateTimeout​(Duration timeout)
        Sets the validate timeout.
        Parameters:
        timeout - to set
      • getOnSuccess

        public Consumer<Connection> getOnSuccess()
        Returns a consumer to handle a connection that has been successfully validated.
        Returns:
        success consumer
      • setOnSuccess

        public void setOnSuccess​(Consumer<Connection> consumer)
        Sets a consumer to handle a connection that has been successfully validated.
        Parameters:
        consumer - to invoke on success
      • getOnFailure

        public Consumer<Connection> getOnFailure()
        Returns a consumer to handle a connection that has failed validation.
        Returns:
        failure consumer
      • setOnFailure

        public void setOnFailure​(Consumer<Connection> consumer)
        Sets a consumer to handle a connection that has failed validation.
        Parameters:
        consumer - to invoke on failure
      • getTimeoutIsFailure

        public boolean getTimeoutIsFailure()
        Returns whether a timeout should be considered a validation failure.
        Returns:
        whether a timeout should be considered a validation failure
      • setTimeoutIsFailure

        public void setTimeoutIsFailure​(boolean failure)
        Sets whether a timeout should be considered a validation failure.
        Parameters:
        failure - whether a timeout should be considered a validation failure