R - the type of query resultspublic class DelegateClient<R> extends Object implements DiscoveryClient<R>
DiscoveryClient that delegates the execution of queries to another DiscoveryClient that
does not perform result parsing and the parsing itself to a dedicated ResultParser.| Constructor and Description |
|---|
DelegateClient(ResultParser<R> parser,
DiscoveryClient<String> inner)
Creates an instance with a given
ResultParser and a DiscoveryClient that produces untyped results |
| Modifier and Type | Method and Description |
|---|---|
List<R> |
submit(Query query)
Submits a
Query for remote execution and returns a list of typed results. |
public DelegateClient(ResultParser<R> parser, DiscoveryClient<String> inner)
ResultParser and a DiscoveryClient that produces untyped resultsparser - the parserinner - the clientpublic List<R> submit(Query query) throws DiscoveryException, InvalidResultException
Query for 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.
submit in interface DiscoveryClient<R>query - the queryDiscoveryException - 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.Copyright © 2023. All Rights Reserved.