Package org.ldaptive
Class SearchConnectionValidator
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.AbstractConnectionValidator
-
- org.ldaptive.AbstractOperationConnectionValidator<SearchRequest,SearchResponse>
-
- org.ldaptive.SearchConnectionValidator
-
- All Implemented Interfaces:
Function<Connection,Boolean>
,ConnectionValidator
,Freezable
public class SearchConnectionValidator extends AbstractOperationConnectionValidator<SearchRequest,SearchResponse>
Validates a connection is healthy by performing a search operation. UnlessAbstractOperationConnectionValidator.setValidResultCodes(ResultCode...)
is set, validation is considered successful if the search result contains any result code.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchConnectionValidator.Builder
Search 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 SearchConnectionValidator()
Creates a new search validator.SearchConnectionValidator(Duration period, Duration timeout, SearchRequest request)
Creates a new search validator.SearchConnectionValidator(SearchRequest sr)
Creates a new search validator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static SearchConnectionValidator.Builder
builder()
Creates a builder for this class.SearchRequest
getSearchRequest()
Deprecated.protected OperationHandle<SearchRequest,SearchResponse>
performOperation(Connection conn)
Perform the operation for this validator.void
setSearchRequest(SearchRequest sr)
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
-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
-
-
-
Constructor Detail
-
SearchConnectionValidator
public SearchConnectionValidator()
Creates a new search validator.
-
SearchConnectionValidator
public SearchConnectionValidator(SearchRequest sr)
Creates a new search validator.- Parameters:
sr
- to use for searches
-
SearchConnectionValidator
public SearchConnectionValidator(Duration period, Duration timeout, SearchRequest request)
Creates a new search validator.- Parameters:
period
- execution periodtimeout
- execution timeoutrequest
- to use for searches
-
-
Method Detail
-
getSearchRequest
@Deprecated public SearchRequest getSearchRequest()
Deprecated.Returns the search request.- Returns:
- search request
-
setSearchRequest
@Deprecated public void setSearchRequest(SearchRequest sr)
Deprecated.Sets the search request.- Parameters:
sr
- search request
-
performOperation
protected OperationHandle<SearchRequest,SearchResponse> performOperation(Connection conn)
Description copied from class:AbstractOperationConnectionValidator
Perform the operation for this validator.- Specified by:
performOperation
in classAbstractOperationConnectionValidator<SearchRequest,SearchResponse>
- Parameters:
conn
- to validate- Returns:
- operation handle
-
toString
public String toString()
- Overrides:
toString
in classAbstractOperationConnectionValidator<SearchRequest,SearchResponse>
-
builder
public static SearchConnectionValidator.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-