org.gcube.data.tml.proxies
Class DefaultTReader

java.lang.Object
  extended by org.gcube.data.tml.proxies.DefaultTReader
All Implemented Interfaces:
TReader

public class DefaultTReader
extends Object
implements TReader


Constructor Summary
DefaultTReader(org.gcube.common.clients.delegates.ProxyDelegate<TReaderStub> delegate)
           
 
Method Summary
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.trees.patterns.Pattern pattern)
          Returns all the Trees in the bound source which match a given Pattern.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.streams.Stream<String> ids, org.gcube.data.trees.patterns.Pattern pattern)
          Returns Trees in the bound source from their identifiers, after pruning them with a Pattern.
 org.gcube.data.trees.data.Tree get(String id)
          Returns a Tree with a given identifier in the bound source.
 org.gcube.data.trees.data.Tree get(String id, org.gcube.data.trees.patterns.Pattern pattern)
          Returns a Tree in with a given identifier the bound source, after pruning it with a Pattern.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(URI locator, org.gcube.data.trees.patterns.Pattern pattern)
          Returns Trees in the bound source from their identifiers, after pruning them with a Pattern.
 org.gcube.data.trees.data.Node getNode(String... path)
          Returns a Node in the bound source from its path in a tree, i.e.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Node> getNodes(org.gcube.data.streams.Stream<Path> paths)
          Returns Nodes from their paths in a tree, i.e.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Node> getNodes(URI paths)
          Returns Nodes from their paths in a tree, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTReader

public DefaultTReader(org.gcube.common.clients.delegates.ProxyDelegate<TReaderStub> delegate)
Method Detail

get

public org.gcube.data.trees.data.Tree get(String id)
                                   throws UnknownTreeException
Description copied from interface: TReader
Returns a Tree with a given identifier in the bound source.

Specified by:
get in interface TReader
Parameters:
id - the tree identifier
Returns:
the tree
Throws:
UnknownTreeException - if the identifier does not identify a tree in the bound source

get

public org.gcube.data.trees.data.Tree get(String id,
                                          org.gcube.data.trees.patterns.Pattern pattern)
                                   throws UnknownTreeException,
                                          InvalidTreeException
Description copied from interface: TReader
Returns a Tree in with a given identifier the bound source, after pruning it with a Pattern.

Specified by:
get in interface TReader
Parameters:
id - the tree identifier
pattern - the pattern
Returns:
the pruned tree
Throws:
UnknownTreeException - if the identifier does not identify a tree in the bound source
InvalidTreeException - if the identified tree does not match the pattern

get

public org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.streams.Stream<String> ids,
                                                                         org.gcube.data.trees.patterns.Pattern pattern)
Description copied from interface: TReader
Returns Trees in the bound source from their identifiers, after pruning them with a Pattern.

Specified by:
get in interface TReader
pattern - the pattern
Returns:
a Stream of resolved Trees

get

public org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(URI locator,
                                                                         org.gcube.data.trees.patterns.Pattern pattern)
                                                                  throws UnsupportedOperationException,
                                                                         org.gcube.common.clients.exceptions.UnsupportedRequestException,
                                                                         org.gcube.common.clients.exceptions.ServiceException
Description copied from interface: TReader
Returns Trees in the bound source from their identifiers, after pruning them with a Pattern.

Specified by:
get in interface TReader
Parameters:
locator - a locator to a stream of tree identifiers
pattern - the pattern
Returns:
a Stream of resolved Trees
Throws:
org.gcube.common.clients.exceptions.UnsupportedOperationException - if the bound source does not support the operation
org.gcube.common.clients.exceptions.UnsupportedRequestException - if the bound source does not support this particular request
org.gcube.common.clients.exceptions.DiscoveryException - if the proxy is created in discovery mode but no service endpoints can be discovered
org.gcube.common.clients.exceptions.ServiceException - if the call fails for any other error
UnsupportedOperationException

get

public org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.trees.patterns.Pattern pattern)
Description copied from interface: TReader
Returns all the Trees in the bound source which match a given Pattern.

Specified by:
get in interface TReader
Parameters:
pattern - the pattern
Returns:
a Stream of matching Trees

getNode

public org.gcube.data.trees.data.Node getNode(String... path)
                                       throws UnknownPathException
Description copied from interface: TReader
Returns a Node in the bound source from its path in a tree, i.e. the list of of one or more identifiers of the nodes that connect it to the root of the tree.

Specified by:
getNode in interface TReader
Parameters:
path - the node identifiers
Returns:
the node
Throws:
UnknownPathException - if the identifiers do not identify a node in the bound source

getNodes

public org.gcube.data.streams.Stream<org.gcube.data.trees.data.Node> getNodes(org.gcube.data.streams.Stream<Path> paths)
Description copied from interface: TReader
Returns Nodes from their paths in a tree, i.e. lists of identifiers of the nodes that connect them to the root of a tree.

Specified by:
getNodes in interface TReader
Parameters:
paths - a Stream of Paths
Returns:
a Stream of Nodes

getNodes

public org.gcube.data.streams.Stream<org.gcube.data.trees.data.Node> getNodes(URI paths)
Description copied from interface: TReader
Returns Nodes from their paths in a tree, i.e. lists of identifiers of the nodes that connect them to the root of a tree.

Specified by:
getNodes in interface TReader
Parameters:
paths - a locator to a stream of paths
Returns:
a Stream of Nodes


Copyright © 2013. All Rights Reserved.