From ec5cd1ea03428cc580ccc2c20645fbdcfb22fd8a Mon Sep 17 00:00:00 2001 From: "fabio.simeoni" Date: Tue, 15 Jan 2013 10:44:07 +0000 Subject: [PATCH] merged from trunk git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/information-system/discovery-client/1.0@67597 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 8 +---- .../discovery/client/api/DiscoveryClient.java | 12 ------- .../discovery/client/impl/DelegateClient.java | 33 ------------------- 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/pom.xml b/pom.xml index 7d5b21c..069d133 100644 --- a/pom.xml +++ b/pom.xml @@ -26,13 +26,7 @@ - - - org.gcube.data.access - streams - [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) - - + org.slf4j slf4j-api diff --git a/src/main/java/org/gcube/resources/discovery/client/api/DiscoveryClient.java b/src/main/java/org/gcube/resources/discovery/client/api/DiscoveryClient.java index 3bfff1c..a034128 100644 --- a/src/main/java/org/gcube/resources/discovery/client/api/DiscoveryClient.java +++ b/src/main/java/org/gcube/resources/discovery/client/api/DiscoveryClient.java @@ -2,7 +2,6 @@ package org.gcube.resources.discovery.client.api; import java.util.List; -import org.gcube.data.streams.Stream; import org.gcube.resources.discovery.client.queries.api.Query; /** @@ -27,15 +26,4 @@ public interface DiscoveryClient { * tolerance to parsing errors before raising this exception. */ List submit(Query query) throws DiscoveryException, InvalidResultException; - - /** - * Submits a {@link Query} for remote execution and returns a {@link Stream} of typed results. - *

- * Parsing errors may and should be delivered as {@link InvalidResultException}s during stream iteration. - * - * @param query the query - * @return the results - * @throws DiscoveryException if the query cannot be submitted - */ - Stream submitForStream(Query query) throws DiscoveryException; } diff --git a/src/main/java/org/gcube/resources/discovery/client/impl/DelegateClient.java b/src/main/java/org/gcube/resources/discovery/client/impl/DelegateClient.java index 3a16ce5..430c7af 100644 --- a/src/main/java/org/gcube/resources/discovery/client/impl/DelegateClient.java +++ b/src/main/java/org/gcube/resources/discovery/client/impl/DelegateClient.java @@ -1,14 +1,8 @@ package org.gcube.resources.discovery.client.impl; -import static org.gcube.data.streams.dsl.Streams.*; - import java.util.ArrayList; import java.util.List; -import org.gcube.data.streams.Stream; -import org.gcube.data.streams.exceptions.StreamSkipSignal; -import org.gcube.data.streams.exceptions.StreamStopSignal; -import org.gcube.data.streams.generators.Generator; import org.gcube.resources.discovery.client.api.DiscoveryClient; import org.gcube.resources.discovery.client.api.DiscoveryException; import org.gcube.resources.discovery.client.api.InvalidResultException; @@ -71,31 +65,4 @@ public class DelegateClient implements DiscoveryClient { return parsed; } - - /** - * {@inheritDoc} - *

- * Result parsing errors are only logged as long as they do results are successfully parsed. Otherwise, the - * client flags the parsing errors as likely due to the parser itself. - */ - public Stream submitForStream(Query query) throws DiscoveryException { - - Stream unparsed = inner.submitForStream(query); - - return pipe(unparsed).through(new ParsingGenerator()); - - } - - //helper - private class ParsingGenerator implements Generator { - - public R yield(String result) throws StreamSkipSignal, StreamStopSignal { - try { - return parser.parse(result); - } - catch(Exception e) { - throw new InvalidResultException(e); - } - } - } }