public abstract class AbstractFederationStrategy extends Object implements FederationStrategy
FederationStrategy
interface. Other
classes can extend this class to create specific attributes to sort by.Modifier and Type | Field and Description |
---|---|
protected List<PostFederatedQueryPlugin> |
postQuery
|
protected List<PreFederatedQueryPlugin> |
preQuery
|
Constructor and Description |
---|
AbstractFederationStrategy(ExecutorService queryExecutorService)
Deprecated.
- only to provide support for deprecated FifoFederationStrategy and
SortedFederationStrategy
|
AbstractFederationStrategy(ExecutorService queryExecutorService,
List<PreFederatedQueryPlugin> preQuery,
List<PostFederatedQueryPlugin> postQuery)
Instantiates an
AbstractFederationStrategy with the provided ExecutorService . |
Modifier and Type | Method and Description |
---|---|
protected abstract Runnable |
createMonitor(ExecutorService queryExecutorService,
Map<Source,Future<SourceResponse>> futures,
QueryResponseImpl returnResults,
Query query)
Creates the monitor for federated queries.
|
QueryResponse |
federate(List<Source> sources,
QueryRequest queryRequest)
Federate the given query to the
List of Source s, returning a QueryResponse back to the user that will include the matching Result s. |
void |
setMaxStartIndex(int maxStartIndex)
To be set via Spring/Blueprint
|
protected List<PreFederatedQueryPlugin> preQuery
protected List<PostFederatedQueryPlugin> postQuery
public AbstractFederationStrategy(ExecutorService queryExecutorService)
AbstractFederationStrategy
with the provided ExecutorService
.queryExecutorService
- the ExecutorService
for queriespublic AbstractFederationStrategy(ExecutorService queryExecutorService, List<PreFederatedQueryPlugin> preQuery, List<PostFederatedQueryPlugin> postQuery)
AbstractFederationStrategy
with the provided ExecutorService
.queryExecutorService
- the ExecutorService
for queriesprotected abstract Runnable createMonitor(ExecutorService queryExecutorService, Map<Source,Future<SourceResponse>> futures, QueryResponseImpl returnResults, Query query)
queryExecutorService
- futures
- returnResults
- the query resultsquery
- Runnable
public QueryResponse federate(List<Source> sources, QueryRequest queryRequest)
FederationStrategy
List
of Source
s, returning a QueryResponse
back to the user that will include the matching Result
s.federate
in interface FederationStrategy
sources
- the List
of Source
s to be queried. Cannot be null
or
empty.queryRequest
- the QueryRequest
to execute. Cannot be null
.QueryResponse
which contains the list of Result
s.public void setMaxStartIndex(int maxStartIndex)
maxStartIndex
- the new default max start index valueThis work is licensed under a Creative Commons Attribution 4.0 International License.