Interface SearchOp<T>
- Type Parameters:
T
- The result type of the translator.
- All Superinterfaces:
SPIOperation
Implement this interface to allow the Connector to search for resource
objects.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateFilterTranslator
(ObjectClass objectClass, OperationOptions options) Creates a filter translator that will translate a specifiedfilter
into one or more native queries.void
executeQuery
(ObjectClass objectClass, T query, ResultsHandler handler, OperationOptions options) ConnectorFacade calls this method once for each native query that the FilterTranslator produces in response to theFilter
passed intoSearchApiOp
.
-
Method Details
-
createFilterTranslator
Creates a filter translator that will translate a specifiedfilter
into one or more native queries. Each of these native queries will be passed subsequently intoexecuteQuery()
.- Parameters:
objectClass
- The object class for the search. Will never be null.options
- additional options that impact the way this operation is run. If the caller passes null, the framework will convert this into an empty set of options, so SPI need not worry about this ever being null.- Returns:
- A filter translator. This must not be
null
. Anull
return value will cause the API (SearchApiOp
) to throwNullPointerException
.
-
executeQuery
void executeQuery(ObjectClass objectClass, T query, ResultsHandler handler, OperationOptions options) ConnectorFacade calls this method once for each native query that the FilterTranslator produces in response to theFilter
passed intoSearchApiOp
. If theFilterTranslator
produces more than one native query, then ConnectorFacade will automatically merge the results from each query and eliminate any duplicates. NOTE that this implies an in-memory data structure that holds a set of Uid values, so memory usage in the event of multiple queries will be O(N) where N is the number of results. This is why it is important that the FilterTranslator for each Connector implement OR if possible.- Parameters:
objectClass
- The object class for the search. Will never be null.query
- The native query to run. A value of null means "return every instance of the given object class".handler
- Results should be returned to this handleroptions
- Additional options that impact the way this operation is run. If the caller passes null, the framework will convert this into an empty set of options, so SPI need not guard against options being null.
-