Package org.ldaptive
Interface ConnectionValidator
-
- All Superinterfaces:
Function<Connection,Boolean>
- All Known Implementing Classes:
AbstractConnectionValidator,AbstractOperationConnectionValidator,CompareConnectionValidator,SearchConnectionValidator
public interface ConnectionValidator extends Function<Connection,Boolean>
Provides an interface for defining connection validation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Supplier<Boolean>applyAsync(Connection conn)Provides an asynchronous implementation ofFunction.apply(Object).voidapplyAsync(Connection conn, Consumer<Boolean> function)Provides an asynchronous implementation ofFunction.apply(Object).DurationgetValidatePeriod()Returns the interval at which the validation task will be executed.DurationgetValidateTimeout()Returns the duration at which a validate operation should be abandoned.
-
-
-
Method Detail
-
applyAsync
void applyAsync(Connection conn, Consumer<Boolean> function)
Provides an asynchronous implementation ofFunction.apply(Object). The supplied consumer will be invoked with the validation result.getValidateTimeout()must be enforced by the caller.- Parameters:
conn- to validatefunction- to consume the validation result
-
applyAsync
Supplier<Boolean> applyAsync(Connection conn)
Provides an asynchronous implementation ofFunction.apply(Object). The returned supplier will block until a validation result is received respectinggetValidateTimeout().- 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 duration at which a validate operation should be abandoned.- Returns:
- validation timeout
-
-