org.gcube.contentmanagement.contentmanager.state
Class WriteManager

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

public class WriteManager
extends CollectionManager

Collections managers of write-only operations

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
WriteManager()
           
 
Method Summary
 java.lang.String add(GDoc doc)
          Adds a gDoc document.
 java.net.URI add(java.net.URI locator)
          Adds zero or more gDoc documents.
 java.lang.String getType()
          Returns the type of the resource.
 void update(GDoc doc)
          Updates a gDoc document.
 java.net.URI update(java.net.URI locator)
          Updates zero or more gDoc documents.
 
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

WriteManager

public WriteManager()
Method Detail

getType

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

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

add

public java.lang.String add(GDoc doc)
                     throws InvalidDocumentException,
                            java.lang.Exception
Adds a gDoc document.

Parameters:
doc - the document.
Returns:
the document's identifier.
Throws:
InvalidDocumentException - if the document is invalid.
java.lang.Exception - if the document is valid but could not be added.

add

public java.net.URI add(java.net.URI locator)
                 throws java.lang.Exception
Adds zero or more gDoc documents.

Parameters:
locator - a locator to a remote resultset of DOM representations of the documents.
Returns:
a locator to a local resultset of AddResponses.
Throws:
java.lang.Exception - if the locator could not be returned.

update

public void update(GDoc doc)
            throws UnknownDocumentException,
                   InvalidDocumentException,
                   java.lang.Exception
Updates a gDoc document.

Parameters:
doc - the updated document.
Throws:
UnknownDocumentException - if the document is unknown.
InvalidDocumentException - if the document is invalid.
java.lang.Exception - if the document is known and valid but could not be updated.

update

public java.net.URI update(java.net.URI locator)
                    throws java.lang.Exception
Updates zero or more gDoc documents.

Parameters:
locator - a locator to a remote resultset of DOM representations of the updated documents.
Returns:
a locator to a local resultset of UpdateResponses.
Throws:
java.lang.Exception - if the locator could not be returned.