public class CoserRequestExecutor extends Object
Modifier and Type | Field and Description |
---|---|
protected CoserCommandFactory |
commandFactory
To create commands.
|
protected FileResult |
fileResult |
protected MapResult |
mapResult |
protected List<ResultRepository> |
matchingRepositories |
protected List<CoserResult> |
multipleResults |
protected CoserMainRepositoryProvider |
repositoryProvider
To get repositories.
|
protected VoidResult |
voidResult |
Constructor and Description |
---|
CoserRequestExecutor(CoserApplicationContext applicationContext,
CoserMainRepositoryProvider repositoryProvider) |
Modifier and Type | Method and Description |
---|---|
protected <Request extends CoserRequest,Repository extends ResultRepository> |
accept(CoserRequestContext context,
Repository repository,
Request request) |
void |
deleteResults(CoserRequestContext context,
DeleteResultsRequest request) |
protected <Request extends CoserRequest,Repository extends ResultRepository> |
execute(CoserRequestContext context,
Repository repository,
Request request) |
CoserRequestExecutor |
executeAll(CoserRequestContext context,
CoserRequest request)
Execute the given
request on any matching result repository. |
CoserRequestExecutor |
executeFirst(CoserRequestContext context,
CoserRequest request)
Execute the given
request on the first matching result repository. |
CoserRequestExecutor |
executeUnique(CoserRequestContext context,
CoserRequest request)
Execute the given
request to obtain a single result. |
FileResult |
executeUnique(CoserRequestContext context,
ExtractRawDataAndResultsRequest request)
Extract some raw data and results from repositories and assembly them as an archive.
|
ResultRepository |
getFirstMatchingRepository() |
List<ResultRepository> |
getMatchingRepositories() |
protected List<ResultRepository> |
getMatchingRepositories(CoserRequestContext context,
CoserRequest request) |
protected <Request extends CoserRequest,Repository extends ResultRepository> |
newCommand(CoserRequestContext context,
Repository repository,
Request request) |
FileResult |
toFileResult() |
Map<String,String> |
toMap() |
MapResult |
toMapResult() |
<Result extends CoserResult> |
toMultipleResult(Class<Result> resultType) |
protected final CoserMainRepositoryProvider repositoryProvider
protected final CoserCommandFactory commandFactory
protected FileResult fileResult
protected List<CoserResult> multipleResults
protected MapResult mapResult
protected VoidResult voidResult
protected List<ResultRepository> matchingRepositories
public CoserRequestExecutor(CoserApplicationContext applicationContext, CoserMainRepositoryProvider repositoryProvider)
public FileResult executeUnique(CoserRequestContext context, ExtractRawDataAndResultsRequest request)
context
- request contextrequest
- extract requestpublic CoserRequestExecutor executeUnique(CoserRequestContext context, CoserRequest request)
request
to obtain a single result.
A unique result repository must match this request, otherwise a DuplicatedResultException
will be thrown.
If no result repository matches the request a NoResultRepositoryFoundException
will be throwncontext
- request contextrequest
- request to executepublic CoserRequestExecutor executeFirst(CoserRequestContext context, CoserRequest request)
request
on the first matching result repository.
If no result repository matches the request a NoResultRepositoryFoundException
will be thrown.context
- request contextrequest
- request to executepublic void deleteResults(CoserRequestContext context, DeleteResultsRequest request)
public CoserRequestExecutor executeAll(CoserRequestContext context, CoserRequest request)
request
on any matching result repository.
If no result repository matches the request a NoResultRepositoryFoundException
will be thrown.context
- request contextrequest
- request to executepublic MapResult toMapResult()
public FileResult toFileResult()
public <Result extends CoserResult> List<Result> toMultipleResult(Class<Result> resultType)
public List<ResultRepository> getMatchingRepositories()
public ResultRepository getFirstMatchingRepository()
protected List<ResultRepository> getMatchingRepositories(CoserRequestContext context, CoserRequest request)
protected <Request extends CoserRequest,Repository extends ResultRepository> boolean accept(CoserRequestContext context, Repository repository, Request request)
protected <Request extends CoserRequest,Repository extends ResultRepository> CoserResult execute(CoserRequestContext context, Repository repository, Request request)
protected <Request extends CoserRequest,Repository extends ResultRepository> CoserCommand<Repository,Request> newCommand(CoserRequestContext context, Repository repository, Request request)
Copyright © 2010–2015 Ifremer. All rights reserved.