Package org.ldaptive

Interface ConnectionValidator

All Superinterfaces:
Function<Connection,Boolean>
All Known Implementing Classes:
AbstractConnectionValidator, CompareConnectionValidator, SearchConnectionValidator

public interface ConnectionValidator extends Function<Connection,Boolean>
Provides an interface for defining connection validation.
  • Method Details

    • applyAsync

      void applyAsync(Connection conn, Consumer<Boolean> function)
      Provides an asynchronous implementation of Function.apply(Object). The supplied consumer will be invoked with the validation result. getValidateTimeout() must be enforced by the caller.
      Parameters:
      conn - to validate
      function - to consume the validation result
    • applyAsync

      Supplier<Boolean> applyAsync(Connection conn)
      Provides an asynchronous implementation of Function.apply(Object). The returned supplier will block until a validation result is received respecting getValidateTimeout().
      Parameters:
      conn - to validate
      Returns:
      supplier to retrieve the validation result
    • getValidatePeriod

      Duration getValidatePeriod()
      Returns the interval at which the validation task will be executed.
      Returns:
      validation period
    • getValidateTimeout

      Duration getValidateTimeout()
      Returns the time at which a validate operation should be abandoned.
      Returns:
      validation timeout