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

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

public abstract class WriteDelegate
extends ManagerDelegate

The delegate of a WriteManager.

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

Constructor Summary
WriteDelegate()
           
 
Method Summary
abstract  java.lang.String add(GDoc doc)
          Adds a gDoc document.
 RemoteIterator<AddOutcome> add(GDocRSIterator iterator)
          Adds zero or more gDoc documents.
abstract  void update(GDoc doc)
          Updates a gDoc document.
 RemoteIterator<UpdateFailure> update(GDocRSIterator iterator)
          Updates a list of gDoc documents.
 
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

WriteDelegate

public WriteDelegate()
Method Detail

add

public abstract 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 RemoteIterator<AddOutcome> add(GDocRSIterator iterator)
                               throws java.lang.Exception
Adds zero or more gDoc documents. It should be overridden in the plugin if the repository support a native bulk operation for add

Parameters:
iterator - an iterator over DOM representations of the documents.
Returns:
an iterator over AddOutcomes.
Throws:
java.lang.Exception - if the iterator could not be returned.

update

public abstract 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 RemoteIterator<UpdateFailure> update(GDocRSIterator iterator)
                                     throws UnknownDocumentException,
                                            InvalidDocumentException,
                                            java.lang.Exception
Updates a list of gDoc documents. It should be overridden in the plugin if the repository support a native bulk operation for update

Parameters:
iterator - an iterator over the documents.
Returns:
an iterator over the UpdateFailures.
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.