org.yawlfoundation.yawl.documentStore
Class DocumentStoreClient

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.Interface_Client
      extended by org.yawlfoundation.yawl.documentStore.DocumentStoreClient
Direct Known Subclasses:
DocStoreClient

public class DocumentStoreClient
extends Interface_Client

An client-side interface to communicate with the YAWL Document Store

Author:
Michael Adams
Created/Last Date:
21/11/11

Field Summary
protected  String _storeURI
           
 
Constructor Summary
DocumentStoreClient()
          Constructs a new, empty DocumentStoreClient object
DocumentStoreClient(String uri)
          Constructs a new DocumentStoreClient object
 
Method Summary
 boolean checkConnection(String handle)
          Check that a session handle is active
 String clearCase(String caseID, String handle)
          Removes all documents from the Document Store matching a case id
 String clearCase(YDocument doc, String handle)
          Removes all documents from the Document Store matching a case id
 String completeCase(String caseID, String handle)
          Removes all documents from the Document Store matching a case id
 String completeCase(YDocument doc, String handle)
          Removes all documents from the Document Store matching a case id
 String connect(String userID, String password)
          Connects an external entity to the document store
 void disconnect(String handle)
          Disconnects an external entity from the document store
 YDocument getDocument(long docID, String handle)
          Gets a document from the Document Store
 YDocument getDocument(YDocument doc, String handle)
          Gets a document from the Document Store
 String putDocument(YDocument doc, String handle)
          Stores a document in the Document Store
 String removeDocument(long docID, String handle)
          Removes a document from the Document Store
 String removeDocument(YDocument doc, String handle)
          Removes a document from the Document Store
 void setURI(String uri)
          Sets the document store URI for this client
 
Methods inherited from class org.yawlfoundation.yawl.engine.interfce.Interface_Client
executeGet, executePost, prepareParamMap, setReadTimeout, stripOuterElement, successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_storeURI

protected String _storeURI
Constructor Detail

DocumentStoreClient

public DocumentStoreClient()
Constructs a new, empty DocumentStoreClient object


DocumentStoreClient

public DocumentStoreClient(String uri)
Constructs a new DocumentStoreClient object

Parameters:
uri - the uri of the YAWL document store
Method Detail

setURI

public void setURI(String uri)
Sets the document store URI for this client

Parameters:
uri - the uri of the YAWL document store

connect

public String connect(String userID,
                      String password)
               throws IOException
Connects an external entity to the document store

Parameters:
userID - the userid
password - the corresponding password
Returns:
a sessionHandle if successful, or a failure message if not
Throws:
IOException - if the service can't be reached

checkConnection

public boolean checkConnection(String handle)
                        throws IOException
Check that a session handle is active

Parameters:
handle - the session handle to check
Returns:
"true" if the handle is valid and active, "false" if otherwise
Throws:
IOException - if the service can't be reached

disconnect

public void disconnect(String handle)
                throws IOException
Disconnects an external entity from the document store

Parameters:
handle - the sessionHandle to disconnect
Throws:
IOException - if the service can't be reached

putDocument

public String putDocument(YDocument doc,
                          String handle)
                   throws IOException
Stores a document in the Document Store

Parameters:
doc - the YDocument to store. If the YDocument's id matches an existing document in the Store, this 'put' is treated as an update rather that a new document insertion
handle - a valid session handle
Returns:
the document id (as a String) if successful, otherwise an error message
Throws:
IOException - if the service can't be reached

getDocument

public YDocument getDocument(YDocument doc,
                             String handle)
                      throws IOException
Gets a document from the Document Store

Parameters:
doc - the YDocument to get. The YDocument's id must match an existing document
handle - a valid session handle
Returns:
the YDocument with the document (i.e. the binary file) inserted, if successful
Throws:
IOException - if the service can't be reached

getDocument

public YDocument getDocument(long docID,
                             String handle)
                      throws IOException
Gets a document from the Document Store

Parameters:
docID - the id of the document to get. The id must match an existing document
handle - a valid session handle
Returns:
the YDocument with the document (i.e. the binary file) inserted, if successful
Throws:
IOException - if the service can't be reached

removeDocument

public String removeDocument(YDocument doc,
                             String handle)
                      throws IOException
Removes a document from the Document Store

Parameters:
doc - the YDocument to remove. The YDocument's id must match an existing document
handle - a valid session handle
Returns:
a success or error message
Throws:
IOException - if the service can't be reached

removeDocument

public String removeDocument(long docID,
                             String handle)
                      throws IOException
Removes a document from the Document Store

Parameters:
docID - the id of the document to remove. The id must match an existing document
handle - a valid session handle
Returns:
a success or error message
Throws:
IOException - if the service can't be reached

clearCase

public String clearCase(YDocument doc,
                        String handle)
                 throws IOException
Removes all documents from the Document Store matching a case id

Parameters:
doc - a YDocument containing the case id of the documents to remove
handle - a valid session handle
Returns:
a success or error message
Throws:
IOException - if the service can't be reached

clearCase

public String clearCase(String caseID,
                        String handle)
                 throws IOException
Removes all documents from the Document Store matching a case id

Parameters:
caseID - the case id of the documents to remove
handle - a valid session handle
Returns:
a success or error message
Throws:
IOException - if the service can't be reached

completeCase

public String completeCase(YDocument doc,
                           String handle)
                    throws IOException
Removes all documents from the Document Store matching a case id

Parameters:
doc - a YDocument containing the case id of the documents to remove
handle - a valid session handle
Returns:
a success or error message
Throws:
IOException - if the service can't be reached

completeCase

public String completeCase(String caseID,
                           String handle)
                    throws IOException
Removes all documents from the Document Store matching a case id

Parameters:
caseID - the case id of the documents to remove
handle - a valid session handle
Returns:
a success or error message
Throws:
IOException - if the service can't be reached


Copyright © 2004-2012 The YAWL Foundation.