org.gcube.contentmanagement.contentmanager.plugin.delegates
Class ReadDelegate

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.plugin.delegates.ManagerDelegate
      extended by org.gcube.contentmanagement.contentmanager.plugin.delegates.ReadDelegate
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultReader

public abstract class ReadDelegate
extends ManagerDelegate

The delegate of a ReadManager.

Author:
Fabio Simeoni (University of Strathclyde)
See Also:
Serialized Form

Constructor Summary
ReadDelegate()
           
 
Method Summary
abstract  RemoteIterator<GDoc> get(Predicate projection)
          Returns all the gDoc documents, requesting the application of a projection over each of them.
 RemoteIterator<GDoc> get(RSIterator<java.lang.String> iterator, Predicate projection)
          Returns zero or more gDoc documents from their identifiers, requesting the preliminary application of a filter and a projection over each of them.
abstract  GDoc get(java.lang.String id, Predicate projection)
          Returns a gDoc document from its identifier, requesting the preliminary application of a filter and a projection over it.
 Node getNode(java.lang.String... path)
          Returns a gDoc document node from the path of identifiers which connects it to the root.
 RemoteIterator<Node> getNodes(RSIterator<Path> iterator)
          Returns the document nodes identified by corresponding Paths into documents of the target collection.
 
Methods inherited from class org.gcube.contentmanagement.contentmanager.plugin.delegates.ManagerDelegate
getCollection, setCollection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadDelegate

public ReadDelegate()
Method Detail

get

public abstract GDoc get(java.lang.String id,
                         Predicate projection)
                  throws UnknownDocumentException,
                         GCUBEException,
                         java.lang.Exception
Returns a gDoc document from its identifier, requesting the preliminary application of a filter and a projection over it.

Parameters:
id - the identifier.
projection - the projection predicate, or null if no projection is required.
filter - the filter predicate, or null if no filter is required..
Returns:
the document.
Throws:
UnknownDocumentException - if the document is unknown.
java.lang.Exception - if the document could not be returned for a local error.
GCUBEException - if the document could not be returned for a remote error.

get

public RemoteIterator<GDoc> get(RSIterator<java.lang.String> iterator,
                                Predicate projection)
                         throws java.lang.Exception,
                                GCUBEException
Returns zero or more gDoc documents from their identifiers, requesting the preliminary application of a filter and a projection over each of them.

Parameters:
a - remote iterator over document identifiers.
projection - the projection predicate.
filter - the filter predicate.
Returns:
a local iterator over the DOM representations of the documents.
Throws:
java.lang.Exception - if the locator to the remote resultset could not be returned for a local error.
GCUBEException - if the locator to the remote resultset could not be returned for a remote error.

getNodes

public RemoteIterator<Node> getNodes(RSIterator<Path> iterator)
                              throws java.lang.Exception,
                                     GCUBEException
Returns the document nodes identified by corresponding Paths into documents of the target collection.

Parameters:
a - locator to a ResultSet of paths.
Returns:
a locator a ResultSet of document nodes.
Throws:
GCUBEException - if the document nodes could not be returned for a generic remote error.
java.lang.Exception - if the document nodes could not be returned for a generic local error.

getNode

public Node getNode(java.lang.String... path)
             throws UnknownPathFault,
                    java.lang.Exception
Returns a gDoc document node from the path of identifiers which connects it to the root.

Parameters:
ids - the identifiers that form of the path.
Returns:
the document node.
Throws:
UnknownPathException - if the path does not lead to a document node.
java.lang.Exception - if the document node could not be returned.
UnknownPathFault

get

public abstract RemoteIterator<GDoc> get(Predicate projection)
                                  throws java.lang.Exception,
                                         GCUBEException
Returns all the gDoc documents, requesting the application of a projection over each of them.

Parameters:
projection - the projection predicate.
Returns:
an iterator over the DOM representations of the documents.
Throws:
java.lang.Exception - if the locator to the remote resultset could not be returned for a local error.
GCUBEException - if the locator to the remote resultset could not be returned for a remote error.