org.gcube.contentmanagement.contentmanager.stubs.calls
Class WriteManagerCall

java.lang.Object
  extended by WSCall
      extended by org.gcube.contentmanagement.contentmanager.stubs.calls.BaseCall
          extended by org.gcube.contentmanagement.contentmanager.stubs.calls.ManagerCall
              extended by org.gcube.contentmanagement.contentmanager.stubs.calls.WriteManagerCall

public class WriteManagerCall
extends ManagerCall

A high-level call to the WriteManager port-type of the Content Manager service.

A WriteManagerCall call may target known service instances or else do its best to find and talk with those which have the required properties. It may be used repeatedly and it will remember the service instance it last used successfully.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.contentmanagement.contentmanager.stubs.calls.ManagerCall
ManagerCall.DiscoveryException
 
Constructor Summary
WriteManagerCall(GCUBEScope scope, GCUBESecurityManager... securityManager)
          Creates an instance to use in a given scope and, optionally, with a given a security manager.
WriteManagerCall(java.lang.String collectionID, GCUBEScope scope, GCUBESecurityManager... securityManager)
          Creates an instance to use for a certain collection, in a given scope and, optionally, with a given a security manager.
 
Method Summary
 java.lang.String add(org.w3c.dom.Element doc)
          Adds a document to the target collection.
 java.lang.String add(GDoc doc)
          Adds a document to the target collection.
 java.net.URI add(java.net.URI locator)
          Adds zero or more documents to the target collection.
 void update(GDoc doc)
          Updates a document in the target collection.
 java.net.URI update(java.net.URI locator)
          Updates zero or more documents in the target collection.
 
Methods inherited from class org.gcube.contentmanagement.contentmanager.stubs.calls.ManagerCall
getCollectionID, resetQuery, setCollectionID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteManagerCall

public WriteManagerCall(GCUBEScope scope,
                        GCUBESecurityManager... securityManager)
                 throws java.lang.Exception
Creates an instance to use in a given scope and, optionally, with a given a security manager.

Parameters:
scope - the scope.
securityManager - (optional) the security manager.
Throws:
java.lang.Exception - if the instance could not be created.

WriteManagerCall

public WriteManagerCall(java.lang.String collectionID,
                        GCUBEScope scope,
                        GCUBESecurityManager... securityManager)
                 throws java.lang.Exception
Creates an instance to use for a certain collection, in a given scope and, optionally, with a given a security manager.

Parameters:
collectionID - the collection identifier.
scope - the scope.
securityManager - (optional) the security manager.
Throws:
java.lang.Exception - if the instance could not be created.
Method Detail

add

public java.lang.String add(GDoc doc)
                     throws java.lang.Exception,
                            ManagerCall.DiscoveryException,
                            InvalidDocumentException,
                            GCUBEException
Adds a document to the target collection.

Parameters:
doc - the document.
Returns:
the identifier assigned to the document.
Throws:
java.lang.Exception - if the document could not be added to the target collection due to a local error.
DiscoveryException - if a Write Manager for the target collection could not be found.
InvalidDocumentException - if the document is invalid.
java.lang.Exception - if the document could not be added to the target collection due to a general local error.
GCUBEException - if the document could not be added to the target collection due to a general remote error.
ManagerCall.DiscoveryException

add

public java.lang.String add(org.w3c.dom.Element doc)
                     throws java.lang.Exception,
                            ManagerCall.DiscoveryException,
                            InvalidDocumentException,
                            GCUBEException
Adds a document to the target collection.

Parameters:
doc - the (DOM representation of the) document.
Returns:
the identifier assigned to the document.
Throws:
DiscoveryException - if a Write Manager for the target collection could not be found.
InvalidDocumentException - if the document is invalid.
java.lang.Exception - if the document could not be added to the target collection due to a general local error.
GCUBEException - if the document could not be added to the target collection due to a general remote error.
ManagerCall.DiscoveryException

add

public java.net.URI add(java.net.URI locator)
                 throws java.lang.Exception,
                        ManagerCall.DiscoveryException,
                        GCUBEException
Adds zero or more documents to the target collection.

Parameters:
a - locator to a ResultSet of of gDoc documents.
Returns:
a locator to a resultSet of AddOutcomes.
Throws:
java.lang.Exception - if the document could not be added to the target collection due to a local error.
DiscoveryException - if a Write Manager for the target collection could not be found.
GCUBEException - if the document could not be added to the target collection due to a remote error.
ManagerCall.DiscoveryException

update

public void update(GDoc doc)
            throws java.lang.Exception,
                   ManagerCall.DiscoveryException,
                   InvalidDocumentException,
                   UnknownDocumentException,
                   GCUBEException
Updates a document in the target collection.

Parameters:
doc - the delta document that captures the update.
Throws:
java.lang.Exception - if the document could not be added to the target collection due to a local error.
DiscoveryException - if a Write Manager for the target collection could not be found.
InvalidDocumentException - if the delta document is invalid.
UnknownDocumentException - if the document is unknown (cannot be identified from the delta document).
GCUBEException - if the document could not be added to the target collection due to a remote error.
ManagerCall.DiscoveryException

update

public java.net.URI update(java.net.URI locator)
                    throws java.lang.Exception,
                           ManagerCall.DiscoveryException,
                           GCUBEException
Updates zero or more documents in the target collection.

Parameters:
locator - a locator to a ResultSet of delta documents that capture the updates.
Returns:
a locator to a ResultSet of UpdateFailures.
Throws:
java.lang.Exception - if the document could not be added to the target collection due to a local error.
DiscoveryException - if a Write Manager for the target collection could not be found.
GCUBEException - if the document could not be added to the target collection due to a remote error.
ManagerCall.DiscoveryException