Package org.ldaptive
Interface ConnectionValidator
-
- All Superinterfaces:
java.util.function.Function<Connection,java.lang.Boolean>
- All Known Implementing Classes:
AbstractConnectionValidator
,CompareConnectionValidator
,SearchConnectionValidator
public interface ConnectionValidator extends java.util.function.Function<Connection,java.lang.Boolean>
Provides an interface for defining connection validation.- Author:
- Middleware Services
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.function.Supplier<java.lang.Boolean>
applyAsync(Connection conn)
Provides an asynchronous implementation ofFunction.apply(Object)
.void
applyAsync(Connection conn, java.util.function.Consumer<java.lang.Boolean> function)
Provides an asynchronous implementation ofFunction.apply(Object)
.java.time.Duration
getValidatePeriod()
Returns the interval at which the validation task will be executed.java.time.Duration
getValidateTimeout()
Returns the time at which a validate operation should be abandoned.
-
-
-
Method Detail
-
applyAsync
void applyAsync(Connection conn, java.util.function.Consumer<java.lang.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
java.util.function.Supplier<java.lang.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
java.time.Duration getValidatePeriod()
Returns the interval at which the validation task will be executed.- Returns:
- validation period
-
getValidateTimeout
java.time.Duration getValidateTimeout()
Returns the time at which a validate operation should be abandoned.- Returns:
- validation timeout
-
-