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>

public class DelegateClient<R> extends Object implements 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 Details

  • Method Details

    • submit

      public List<R> submit(Query query) throws DiscoveryException, InvalidResultException
      Submits a 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.

      Specified by:
      submit in interface DiscoveryClient<R>
      Parameters:
      query - the query
      Returns:
      the results
      Throws:
      DiscoveryException - if the query cannot be submitted
      InvalidResultException - if the results cannot be parsed. Implementations may adopt different degrees of tolerance to parsing errors before raising this exception.