org.gcube.data.tml.clients
Interface TReaderClient

All Known Implementing Classes:
ReaderClient

public interface TReaderClient

A high-level interface to T-Reader services.

T-Reader services give read-only access to given data sources under a tree-based data model.

Clients may target T-Reader services at known endpoints (direct mode ). Alternative, they may discover T-Reader services bound to given sources ( discovery mode).

In discovery mode, clients attempt to interact with discovered services, until they succeed with one. They then cache the the endpoint of this service and use it first for subsequent interactions.

Author:
Fabio Simeoni
See Also:
TBinderClient

Method Summary
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get()
          Returns all the Trees in the bound source.
 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> identifiers)
          Returns Trees in the bound source with given identifiers.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.streams.Stream<String> identifiers, 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 in the bound source with a given identifier.
 org.gcube.data.trees.data.Tree get(String id, org.gcube.data.trees.patterns.Pattern pattern)
          Returns a Tree in the bound source with a given identifier, after pruning it with a Pattern.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(URI loc)
          Returns Trees in the bound source with given identifiers.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(URI loc, org.gcube.data.trees.patterns.Pattern pattern)
          Returns Trees in the bound source from their identifiers, after pruning them with a Pattern.
 Element getAsElement(String id)
          Returns a Tree in the bound source with a given identifier.
 Element getAsElement(String id, org.gcube.data.trees.patterns.Pattern pattern)
          Returns a Tree in the bound source with a given identifier, after pruning it 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.
 Element getNodeAsElement(String... ids)
          Returns a Node in the bound source from its path in a tree, Returns a Node from its in a tree, i.e.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Node> getNodes(org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.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.
 

Method Detail

get

org.gcube.data.trees.data.Tree get(String id)
                                   throws org.gcube.common.clients.DiscoveryException,
                                          UnsupportedOperationException,
                                          UnsupportedRequestException,
                                          UnknownTreeException,
                                          Exception
Returns a Tree in the bound source with a given identifier.

Parameters:
id - the tree identifier
Returns:
the tree
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
UnknownTreeException - if the identifier does not identify a tree in the bound source
Exception - if the operation fails for an unexpected error

get

org.gcube.data.trees.data.Tree get(String id,
                                   org.gcube.data.trees.patterns.Pattern pattern)
                                   throws org.gcube.common.clients.DiscoveryException,
                                          UnsupportedOperationException,
                                          UnsupportedRequestException,
                                          UnknownTreeException,
                                          Exception
Returns a Tree in the bound source with a given identifier, after pruning it with a Pattern.

Parameters:
id - the tree identifier
pattern - the pattern
Returns:
the Element representation of the tree
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
UnknownTreeException - if the identifier does not identify a tree in the bound source
Exception - if the operation fails for an unexpected error

getAsElement

Element getAsElement(String id)
                     throws org.gcube.common.clients.DiscoveryException,
                            UnsupportedOperationException,
                            UnsupportedRequestException,
                            UnknownTreeException,
                            Exception
Returns a Tree in the bound source with a given identifier.

Parameters:
id - the tree identifier
Returns:
the Element representation of the tree
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnknownTreeException - if the identifier does not identify a tree in the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

getAsElement

Element getAsElement(String id,
                     org.gcube.data.trees.patterns.Pattern pattern)
                     throws org.gcube.common.clients.DiscoveryException,
                            UnsupportedOperationException,
                            UnsupportedRequestException,
                            UnknownTreeException,
                            Exception
Returns a Tree in the bound source with a given identifier, after pruning it with a Pattern.

Parameters:
id - the tree identifier
pattern - the pattern
Returns:
the Element representation of the tree
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
UnknownTreeException - if the identifier does not identify a tree in the bound source
Exception - if the operation fails for an unexpected error

getNode

org.gcube.data.trees.data.Node getNode(String... path)
                                       throws IllegalArgumentException,
                                              org.gcube.common.clients.DiscoveryException,
                                              UnsupportedOperationException,
                                              UnsupportedRequestException,
                                              UnknownPathException,
                                              Exception
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.

Parameters:
path - the node identifiers
Returns:
the node
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
UnknownPathException - if the identifiers do not identify a node in the bound source
Exception - if the operation fails for an unexpected error
IllegalArgumentException

getNodeAsElement

Element getNodeAsElement(String... ids)
                         throws org.gcube.common.clients.DiscoveryException,
                                UnsupportedOperationException,
                                UnsupportedRequestException,
                                UnknownPathException,
                                Exception
Returns a Node in the bound source from its path in a tree, Returns a Node from its in a tree, i.e. the list of identifiers of the nodes that connect it to the root of the tree.

Parameters:
ids - the node identifiers.
Returns:
the Element representation of the node
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
UnknownPathException - if the identifiers do not identify a node in the bound source
Exception - if the operation fails for an unexpected error

get

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(URI loc,
                                                                  org.gcube.data.trees.patterns.Pattern pattern)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Returns Trees in the bound source from their identifiers, after pruning them with a Pattern.

Parameters:
loc - a locator to a Resultset of tree identifiers
pattern - the pattern
Returns:
a Stream of resolved Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

get

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.streams.Stream<String> identifiers,
                                                                  org.gcube.data.trees.patterns.Pattern pattern)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Returns Trees in the bound source from their identifiers, after pruning them with a Pattern.

Parameters:
identifiers - a Stream of tree identifiers
pattern - the pattern
Returns:
a Stream of resolved Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

get

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(URI loc)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Returns Trees in the bound source with given identifiers.

Parameters:
loc - a locator to a Result Set with tree identifiers
Returns:
a Stream of resolved Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

get

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.streams.Stream<String> identifiers)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Returns Trees in the bound source with given identifiers.

Parameters:
identifiers - a Stream of tree identifiers
Returns:
a Stream of resolved Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

get

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get(org.gcube.data.trees.patterns.Pattern pattern)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Returns all the Trees in the bound source which match a given Pattern.

Parameters:
pattern - the pattern
Returns:
a Stream of matching Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

get

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> get()
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Returns all the Trees in the bound source.

Returns:
a Stream of matching Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

getNodes

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Node> getNodes(URI paths)
                                                                       throws org.gcube.common.clients.DiscoveryException,
                                                                              UnsupportedOperationException,
                                                                              UnsupportedRequestException,
                                                                              Exception
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.

Parameters:
paths - a locator to a ResultSet of paths.
Returns:
a Stream of Nodes
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

getNodes

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Node> getNodes(org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.Path> paths)
                                                                       throws org.gcube.common.clients.DiscoveryException,
                                                                              UnsupportedOperationException,
                                                                              UnsupportedRequestException,
                                                                              Exception
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.

Parameters:
paths - a Stream of Paths
Returns:
a Stream of Nodes
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error


Copyright © 2012. All Rights Reserved.