Package org.ldaptive
Class CompareConnectionValidator
- java.lang.Object
-
- org.ldaptive.AbstractConnectionValidator
-
- org.ldaptive.AbstractOperationConnectionValidator<CompareRequest,CompareResponse>
-
- org.ldaptive.CompareConnectionValidator
-
- All Implemented Interfaces:
Function<Connection,Boolean>
,ConnectionValidator
public class CompareConnectionValidator extends AbstractOperationConnectionValidator<CompareRequest,CompareResponse>
Validates a connection is healthy by performing a compare operation. UnlessAbstractOperationConnectionValidator.setValidResultCodes(ResultCode...)
is set, validation is considered successful if the compare result contains any result code.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompareConnectionValidator.Builder
Compare validator builder.-
Nested classes/interfaces inherited from class org.ldaptive.AbstractOperationConnectionValidator
AbstractOperationConnectionValidator.AbstractBuilder<Q extends Request,S extends Result,B,T extends AbstractOperationConnectionValidator<Q,S>>
-
-
Field Summary
-
Fields inherited from class org.ldaptive.AbstractConnectionValidator
DEFAULT_VALIDATE_PERIOD, DEFAULT_VALIDATE_TIMEOUT, logger
-
-
Constructor Summary
Constructors Constructor Description CompareConnectionValidator()
Creates a new compare validator.CompareConnectionValidator(Duration period, Duration timeout, CompareRequest request)
Creates a new compare validator.CompareConnectionValidator(CompareRequest cr)
Creates a new compare validator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CompareConnectionValidator.Builder
builder()
Creates a builder for this class.CompareRequest
getCompareRequest()
Deprecated.protected OperationHandle<CompareRequest,CompareResponse>
performOperation(Connection conn)
Perform the operation for this validator.void
setCompareRequest(CompareRequest cr)
Deprecated.String
toString()
-
Methods inherited from class org.ldaptive.AbstractOperationConnectionValidator
applyAsync, getRequest, getValidResultCodes, setRequest, setValidResultCodes
-
Methods inherited from class org.ldaptive.AbstractConnectionValidator
apply, applyAsync, getOnFailure, getOnSuccess, getTimeoutIsFailure, getValidatePeriod, getValidateTimeout, setOnFailure, setOnSuccess, setTimeoutIsFailure, setValidatePeriod, setValidateTimeout
-
-
-
-
Constructor Detail
-
CompareConnectionValidator
public CompareConnectionValidator()
Creates a new compare validator.
-
CompareConnectionValidator
public CompareConnectionValidator(CompareRequest cr)
Creates a new compare validator.- Parameters:
cr
- to use for compares
-
CompareConnectionValidator
public CompareConnectionValidator(Duration period, Duration timeout, CompareRequest request)
Creates a new compare validator.- Parameters:
period
- execution periodtimeout
- execution timeoutrequest
- to use for searches
-
-
Method Detail
-
getCompareRequest
@Deprecated public CompareRequest getCompareRequest()
Deprecated.Returns the compare request.- Returns:
- compare request
-
setCompareRequest
@Deprecated public void setCompareRequest(CompareRequest cr)
Deprecated.Sets the compare request.- Parameters:
cr
- compare request
-
performOperation
protected OperationHandle<CompareRequest,CompareResponse> performOperation(Connection conn)
Description copied from class:AbstractOperationConnectionValidator
Perform the operation for this validator.- Specified by:
performOperation
in classAbstractOperationConnectionValidator<CompareRequest,CompareResponse>
- Parameters:
conn
- to validate- Returns:
- operation handle
-
toString
public String toString()
- Overrides:
toString
in classAbstractOperationConnectionValidator<CompareRequest,CompareResponse>
-
builder
public static CompareConnectionValidator.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-