org.gcube.contentmanagement.contentmanager.state
Class ReadManager

java.lang.Object
  extended by 
      extended by org.gcube.contentmanagement.contentmanager.state.CollectionManager
          extended by org.gcube.contentmanagement.contentmanager.state.ReadManager

public class ReadManager
extends CollectionManager

CollectionResource manager for read-only operations.

Author:
Fabio Simeoni (University of Strathclyde), Lucio Lelii (lucio.lelii@isti.cnr.it)

Constructor Summary
ReadManager()
           
 
Method Summary
 java.net.URI get(Predicate projection)
          Returns all the gDoc documents, requesting the application of a projection over each of them.
 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.
 java.net.URI get(java.net.URI locator, 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.
 Node getNode(java.lang.String... path)
          Returns a gDoc document node from the path of identifiers which connects it to the root.
 java.net.URI getNodes(java.net.URI paths)
          Returns the document nodes identified by corresponding Paths into documents of the target collection.
 java.lang.String getType()
          Returns the type of the resource.
 
Methods inherited from class org.gcube.contentmanagement.contentmanager.state.CollectionManager
getCardinality, getCollectionID, getLastUpdate, getPlugin, onEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadManager

public ReadManager()
Method Detail

getType

public java.lang.String getType()
Returns the type of the resource.

Specified by:
getType in class CollectionManager
Returns:
the type.

get

public GDoc get(java.lang.String id,
                Predicate projection)
         throws UnknownDocumentException,
                java.lang.Exception,
                GCUBEException
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.
filter - the filter predicate.
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 java.net.URI get(java.net.URI locator,
                        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 - locator to a resultset of document identifiers.
projection - the projection predicate.
filter - the filter predicate.
Returns:
a locator to a remote resultset of DOM representation 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.

get

public java.net.URI 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:
a locator to a remote resultset of DOM representation 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.

getNode

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

Parameters:
path - 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.

getNodes

public java.net.URI getNodes(java.net.URI paths)
                      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.