Class DelegateClient<R>
java.lang.Object
org.gcube.resources.discovery.client.impl.DelegateClient<R>
- Type Parameters:
R- the type of query results
- All Implemented Interfaces:
DiscoveryClient<R>
A
DiscoveryClient that delegates the execution of queries to another DiscoveryClient that
does not perform result parsing and the parsing itself to a dedicated ResultParser.- Author:
- Fabio Simeoni
-
Constructor Summary
ConstructorsConstructorDescriptionDelegateClient(ResultParser<R> parser, DiscoveryClient<String> inner) Creates an instance with a givenResultParserand aDiscoveryClientthat produces untyped results -
Method Summary
-
Constructor Details
-
DelegateClient
Creates an instance with a givenResultParserand aDiscoveryClientthat produces untyped results- Parameters:
parser- the parserinner- the client
-
-
Method Details
-
submit
Submits aQueryfor remote execution and returns a list of typed results.Result parsing errors are only logged as long as some results are successfully parsed. Otherwise, the client flags the parsing errors as likely due to the parser itself.
- Specified by:
submitin interfaceDiscoveryClient<R>- Parameters:
query- the query- Returns:
- the results
- Throws:
DiscoveryException- if the query cannot be submittedInvalidResultException- if the results cannot be parsed. Implementations may adopt different degrees of tolerance to parsing errors before raising this exception.
-