net.kwfgrid.gwes.restfulclient
Class RestfulGWES

java.lang.Object
  extended by net.kwfgrid.gwes.restfulclient.RestfulClient
      extended by net.kwfgrid.gwes.restfulclient.RestfulGWES
All Implemented Interfaces:
Remote, GWES
Direct Known Subclasses:
RestfulStructureGWES

public class RestfulGWES
extends RestfulClient
implements GWES

Version:
$Id: RestfulGWES.java 1537 2011-07-27 15:34:04Z hoheisel $
Author:
Andreas Hoheisel (www.andreas-hoheisel.de)

Nested Class Summary
 
Nested classes/interfaces inherited from class net.kwfgrid.gwes.restfulclient.RestfulClient
RestfulClient.Method
 
Field Summary
static String _PARAM_LEVEL
           
static String _PARAM_NAME
           
static String _PARAM_OLDSTATUS
           
static String _PARAM_PLACEID
           
static String _PARAM_USERID
           
static String ATTRIBUTE_NS
           
static String ELEMENT_DESCRIPTION
           
static String ELEMENT_NAME
           
static String ELEMENT_USERID
           
static String ELEMENT_VALUE
           
static String ELEMENT_WORKFLOWDESCRIPTION
           
static String ELEMENT_WORKFLOWID
           
protected  String gwesServiceUrl
          GWES service URL with ending "/", e.g., http://localhost:8080/gwes/service/GWES/
static String METHOD_ABORT
           
static String METHOD_GETACTIVITYSTATUSARRAY
           
static String METHOD_GETAVAILABLERESOURCES
           
static String METHOD_GETCHECKPOINTS
           
static String METHOD_GETDATA
           
static String METHOD_GETDESCRIPTION
           
static String METHOD_GETPROPERTIES
           
static String METHOD_GETPROPERTY
           
static String METHOD_GETRESOURCEDESCRIPTION_
           
static String METHOD_GETSTATUS
           
static String METHOD_GETWORKFLOWDESCRIPTION
           
static String METHOD_GETWORKFLOWIDS
           
static String METHOD_GETWORKFLOWSTATUSARRAY
           
static String METHOD_INITIATE
           
static String METHOD_REMOVE
           
static String METHOD_RESTART
           
static String METHOD_RESTORE
           
static String METHOD_RESUME
           
static String METHOD_SETDESCRIPTION
           
static String METHOD_SETPROPERTY
           
static String METHOD_SETWORKFLOWDESCRIPTION
           
static String METHOD_START
           
static String METHOD_STORE
           
static String METHOD_SUSPEND
           
static String METHOD_WAITFORSTATUSCHANGEFROM
           
static String METHOD_WAITFORSTATUSCHANGETOCOMPLETEDORTERMINATED
           
static String PARAM_LEVEL
           
static String PARAM_OFCLASS
           
static String PARAM_RESOURCEURI
           
static String PARAM_WORKFLOWID
           
protected static Pattern PATTERN_COLLECTION_NOT_FOUND
           
protected static Pattern PATTERN_PLACE_WORKFLOW_NOT_AVAILABLE
           
protected static Pattern PATTERN_WORKFLOW_NOT_AVAILABLE
           
protected static Pattern PATTERN_WORKFLOW_NOT_AVAILABLE2
           
static String STRING_G
           
static String STRING_L
           
static String STRING_LSLASH
           
static String STRING_SLASH
           
 
Constructor Summary
protected RestfulGWES(String gwesServiceUrl)
          Private constructor for internal use only.
 
Method Summary
 void abort(String workflowID, String userID)
          Abort a workflow with a certain identifier.
 String[][] getActivityStatusArray(String workflowID, String userID)
          Get the status array of all instantiated activities of a given workflow.
 String[] getAvailableResources(String ofClass, String userID)
          Get a list of all available resources.
 String[] getCheckpoints(String workflowID, String userID)
          Get the path of all available checkpoints for a specific workflow.
 String[] getData(String workflowID, String placeID, String userID)
          Get some data that is hold inside a specific workflow and that is referenced by a data place identifier.
 String getDescription(String workflowID, String userID)
          Get the human-readable description for a specific workflow.
static RestfulGWES getInstance()
          Create new or return existing RestfulGWES instance to GWES with service URL as specified by system property.
static RestfulGWES getInstance(String gwesServiceUrl)
          Create new or return existing RestfulGWES instance to GWES with service URL as specified by paramter gwesServiceUrl.
 String[][] getProperties(String workflowID, String userID)
          Get all propertries of a specific workflow.
 String getProperty(String workflowID, String name, String userID)
          Get the value of a specific workflow property.
 String getResourceDescription(String resourceUri, String userID)
          Get the resource description of a specific resource in D-GRDL syntax.
 int getStatus(String workflowID, String userID)
          Get the current status code of the workflow specified by its identifier.
 String getWorkflowDescription(String workflowID, String userID)
          Get the current Generic Workflow Description document of the workflow specified by its identifier.
 String[] getWorkflowIDs(int level, String userID)
          Get the identifiers of all the workflows that are handled by this Generic Workflow Execution Service.
 String[][] getWorkflowStatusArray(int level, String userID)
          Get the workflow status of all currently available workflows.
 String initiate(String gworkflowdl, String userID)
          Initiates a workflow with a certain userID.
protected  String[] localExceptionHttpDELETE(String workflowID, StringBuffer urlBuf)
           
protected  String[] localExceptionHttpGET(String workflowID, StringBuffer urlBuf)
           
protected  String[][] localExceptionHttpGETArray(String workflowID, StringBuffer urlBuf)
           
protected  String[] localExceptionHttpPUT(String workflowID, StringBuffer urlBuf, StringBuffer payload)
           
 void remove(String workflowID, int level, String userID)
          Remove a specific workflow from memory, database, and/or its temporary data on the Grid nodes.
 String restart(String workflowID, String userID)
          Restart a workflow with a certain identifier from the beginning.
 String restore(String workflowID, String userID)
          Restores a workflow from the XML database.
 void resume(String workflowID, String userID)
          Resume a workflow with a certain identifier.
 void setDescription(String workflowID, String description, String userID)
          Set the human-readable description for a specific workflow.
 void setProperty(String workflowID, String name, String value, String userID)
          Set the value of a specific workflow property.
 void setWorkflowDescription(String workflowID, String gworkflowdl, String userID)
          Overwrite the current Generic Workflow Description document of the workflow specified by its identifier.
 void start(String workflowID, String userID)
          Start a workflow with a certain identifier.
 String store(String workflowID, String userID)
          Store a workflow in the XML workflow database.
 void suspend(String workflowID, String userID)
          Suspend a workflow with a certain identifier.
 int waitForStatusChangeFrom(String workflowID, int oldStatus, String userID)
          Wait for workflow to change its status from an specified status.
 int waitForStatusChangeToCompletedOrTerminated(String workflowID, String userID)
          Wait for workflow to change its status to final states COMPLETED or TERMINATED.
 
Methods inherited from class net.kwfgrid.gwes.restfulclient.RestfulClient
getMethodAsString, httpDELETE, httpGET, httpGETArray, httpPOST, httpPUT, request, requestArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING_SLASH

public static final String STRING_SLASH
See Also:
Constant Field Values

STRING_L

public static final String STRING_L
See Also:
Constant Field Values

STRING_G

public static final String STRING_G
See Also:
Constant Field Values

STRING_LSLASH

public static final String STRING_LSLASH
See Also:
Constant Field Values

METHOD_INITIATE

public static final String METHOD_INITIATE
See Also:
Constant Field Values

METHOD_START

public static final String METHOD_START
See Also:
Constant Field Values

METHOD_SUSPEND

public static final String METHOD_SUSPEND
See Also:
Constant Field Values

METHOD_RESUME

public static final String METHOD_RESUME
See Also:
Constant Field Values

METHOD_ABORT

public static final String METHOD_ABORT
See Also:
Constant Field Values

METHOD_RESTART

public static final String METHOD_RESTART
See Also:
Constant Field Values

METHOD_GETWORKFLOWDESCRIPTION

public static final String METHOD_GETWORKFLOWDESCRIPTION
See Also:
Constant Field Values

METHOD_SETWORKFLOWDESCRIPTION

public static final String METHOD_SETWORKFLOWDESCRIPTION
See Also:
Constant Field Values

METHOD_GETSTATUS

public static final String METHOD_GETSTATUS
See Also:
Constant Field Values

METHOD_WAITFORSTATUSCHANGEFROM

public static final String METHOD_WAITFORSTATUSCHANGEFROM
See Also:
Constant Field Values

METHOD_WAITFORSTATUSCHANGETOCOMPLETEDORTERMINATED

public static final String METHOD_WAITFORSTATUSCHANGETOCOMPLETEDORTERMINATED
See Also:
Constant Field Values

METHOD_GETWORKFLOWIDS

public static final String METHOD_GETWORKFLOWIDS
See Also:
Constant Field Values

METHOD_GETWORKFLOWSTATUSARRAY

public static final String METHOD_GETWORKFLOWSTATUSARRAY
See Also:
Constant Field Values

METHOD_STORE

public static final String METHOD_STORE
See Also:
Constant Field Values

METHOD_RESTORE

public static final String METHOD_RESTORE
See Also:
Constant Field Values

METHOD_GETDATA

public static final String METHOD_GETDATA
See Also:
Constant Field Values

METHOD_SETDESCRIPTION

public static final String METHOD_SETDESCRIPTION
See Also:
Constant Field Values

METHOD_GETDESCRIPTION

public static final String METHOD_GETDESCRIPTION
See Also:
Constant Field Values

METHOD_SETPROPERTY

public static final String METHOD_SETPROPERTY
See Also:
Constant Field Values

METHOD_GETPROPERTY

public static final String METHOD_GETPROPERTY
See Also:
Constant Field Values

METHOD_GETPROPERTIES

public static final String METHOD_GETPROPERTIES
See Also:
Constant Field Values

METHOD_GETCHECKPOINTS

public static final String METHOD_GETCHECKPOINTS
See Also:
Constant Field Values

METHOD_REMOVE

public static final String METHOD_REMOVE
See Also:
Constant Field Values

METHOD_GETACTIVITYSTATUSARRAY

public static final String METHOD_GETACTIVITYSTATUSARRAY
See Also:
Constant Field Values

METHOD_GETAVAILABLERESOURCES

public static final String METHOD_GETAVAILABLERESOURCES
See Also:
Constant Field Values

METHOD_GETRESOURCEDESCRIPTION_

public static final String METHOD_GETRESOURCEDESCRIPTION_
See Also:
Constant Field Values

ATTRIBUTE_NS

public static final String ATTRIBUTE_NS
See Also:
Constant Field Values

ELEMENT_WORKFLOWDESCRIPTION

public static final String ELEMENT_WORKFLOWDESCRIPTION
See Also:
Constant Field Values

ELEMENT_USERID

public static final String ELEMENT_USERID
See Also:
Constant Field Values

ELEMENT_WORKFLOWID

public static final String ELEMENT_WORKFLOWID
See Also:
Constant Field Values

ELEMENT_DESCRIPTION

public static final String ELEMENT_DESCRIPTION
See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
See Also:
Constant Field Values

ELEMENT_VALUE

public static final String ELEMENT_VALUE
See Also:
Constant Field Values

PARAM_LEVEL

public static final String PARAM_LEVEL
See Also:
Constant Field Values

PARAM_WORKFLOWID

public static final String PARAM_WORKFLOWID
See Also:
Constant Field Values

PARAM_OFCLASS

public static final String PARAM_OFCLASS
See Also:
Constant Field Values

PARAM_RESOURCEURI

public static final String PARAM_RESOURCEURI
See Also:
Constant Field Values

_PARAM_LEVEL

public static final String _PARAM_LEVEL
See Also:
Constant Field Values

_PARAM_OLDSTATUS

public static final String _PARAM_OLDSTATUS
See Also:
Constant Field Values

_PARAM_PLACEID

public static final String _PARAM_PLACEID
See Also:
Constant Field Values

_PARAM_NAME

public static final String _PARAM_NAME
See Also:
Constant Field Values

_PARAM_USERID

public static final String _PARAM_USERID
See Also:
Constant Field Values

PATTERN_COLLECTION_NOT_FOUND

protected static final Pattern PATTERN_COLLECTION_NOT_FOUND

PATTERN_WORKFLOW_NOT_AVAILABLE

protected static final Pattern PATTERN_WORKFLOW_NOT_AVAILABLE

PATTERN_WORKFLOW_NOT_AVAILABLE2

protected static final Pattern PATTERN_WORKFLOW_NOT_AVAILABLE2

PATTERN_PLACE_WORKFLOW_NOT_AVAILABLE

protected static final Pattern PATTERN_PLACE_WORKFLOW_NOT_AVAILABLE

gwesServiceUrl

protected String gwesServiceUrl
GWES service URL with ending "/", e.g., http://localhost:8080/gwes/service/GWES/

Constructor Detail

RestfulGWES

protected RestfulGWES(String gwesServiceUrl)
               throws Exception
Private constructor for internal use only. Use getInstance() methods instead.

Parameters:
gwesServiceUrl -
Throws:
Exception
Method Detail

getInstance

public static RestfulGWES getInstance()
                               throws Exception
Create new or return existing RestfulGWES instance to GWES with service URL as specified by system property.

Returns:
Throws:
Exception
See Also:
Constants.PROP_SYSTEM_GWES_SERVICE_BASE_URL_INTERNAL

getInstance

public static RestfulGWES getInstance(String gwesServiceUrl)
                               throws Exception
Create new or return existing RestfulGWES instance to GWES with service URL as specified by paramter gwesServiceUrl.

Returns:
Throws:
Exception

localExceptionHttpGET

protected String[] localExceptionHttpGET(String workflowID,
                                         StringBuffer urlBuf)
                                  throws NoSuchWorkflowException,
                                         RemoteException
Throws:
NoSuchWorkflowException
RemoteException

localExceptionHttpGETArray

protected String[][] localExceptionHttpGETArray(String workflowID,
                                                StringBuffer urlBuf)
                                         throws NoSuchWorkflowException,
                                                RemoteException
Throws:
NoSuchWorkflowException
RemoteException

localExceptionHttpPUT

protected String[] localExceptionHttpPUT(String workflowID,
                                         StringBuffer urlBuf,
                                         StringBuffer payload)
                                  throws NoSuchWorkflowException,
                                         RemoteException
Throws:
NoSuchWorkflowException
RemoteException

localExceptionHttpDELETE

protected String[] localExceptionHttpDELETE(String workflowID,
                                            StringBuffer urlBuf)
                                     throws NoSuchWorkflowException,
                                            RemoteException
Throws:
NoSuchWorkflowException
RemoteException

initiate

public String initiate(String gworkflowdl,
                       String userID)
                throws net.kwfgrid.gworkflowdl.structure.WorkflowFormatException,
                       StateTransitionException,
                       RemoteException
Description copied from interface: GWES
Initiates a workflow with a certain userID.

Specified by:
initiate in interface GWES
Parameters:
gworkflowdl - The description of the workflow.
userID - userID|credential: The ID of the user who owns the workflow. Use the DN of the certificate if available. The optional user credential is separated from userID by "|". user ID MUST NOT contain "|" or spaces!
Returns:
The unique workflow ID.
Throws:
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
StateTransitionException
RemoteException

start

public void start(String workflowID,
                  String userID)
           throws NoSuchWorkflowException,
                  StateTransitionException,
                  RemoteException
Description copied from interface: GWES
Start a workflow with a certain identifier.

Specified by:
start in interface GWES
Parameters:
workflowID - The unique workflow identifier.
Throws:
NoSuchWorkflowException
StateTransitionException
RemoteException

suspend

public void suspend(String workflowID,
                    String userID)
             throws NoSuchWorkflowException,
                    StateTransitionException,
                    RemoteException
Description copied from interface: GWES
Suspend a workflow with a certain identifier. This method returns after the workflow has been fully suspended. This may need some time.

Specified by:
suspend in interface GWES
Parameters:
workflowID - The unique workflow identifier.
Throws:
NoSuchWorkflowException
StateTransitionException
RemoteException

resume

public void resume(String workflowID,
                   String userID)
            throws NoSuchWorkflowException,
                   StateTransitionException,
                   RemoteException
Description copied from interface: GWES
Resume a workflow with a certain identifier.

Specified by:
resume in interface GWES
Parameters:
workflowID - The unique workflow identifier.
Throws:
NoSuchWorkflowException
StateTransitionException
RemoteException

abort

public void abort(String workflowID,
                  String userID)
           throws NoSuchWorkflowException,
                  StateTransitionException,
                  RemoteException
Description copied from interface: GWES
Abort a workflow with a certain identifier.

Specified by:
abort in interface GWES
Parameters:
workflowID - The unique workflow identifier.
Throws:
NoSuchWorkflowException
StateTransitionException
RemoteException

restart

public String restart(String workflowID,
                      String userID)
               throws NoSuchWorkflowException,
                      net.kwfgrid.gworkflowdl.structure.WorkflowFormatException,
                      DatabaseException,
                      StateTransitionException,
                      RemoteException
Description copied from interface: GWES
Restart a workflow with a certain identifier from the beginning. The restarted workflow will have a new ID. This method looks for the earliest snapshot of the workflow in the database. Then the GWES initiates the workflow.

Specified by:
restart in interface GWES
Parameters:
workflowID - The unique identifier of the workflow to restart.
userID - The user identifier of the user who owns the workflow.
Returns:
The new workflowID.
Throws:
NoSuchWorkflowException - If the workflow identifier is not available in the workflow database
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException - If the workflow stored in the database has the wrong format
DatabaseException - If there is a problem with retrieving the workflow from the database
StateTransitionException - If the state of the workflow is not INITIATED at the beginning.
RemoteException

getWorkflowDescription

public String getWorkflowDescription(String workflowID,
                                     String userID)
                              throws NoSuchWorkflowException,
                                     RemoteException,
                                     DatabaseException
Description copied from interface: GWES
Get the current Generic Workflow Description document of the workflow specified by its identifier.

Specified by:
getWorkflowDescription in interface GWES
Parameters:
workflowID - The unique workflow identifier.
Returns:
The current workflow description as String.
Throws:
NoSuchWorkflowException
RemoteException
DatabaseException

setWorkflowDescription

public void setWorkflowDescription(String workflowID,
                                   String gworkflowdl,
                                   String userID)
                            throws NoSuchWorkflowException,
                                   StateTransitionException,
                                   net.kwfgrid.gworkflowdl.structure.WorkflowFormatException,
                                   RemoteException
Description copied from interface: GWES
Overwrite the current Generic Workflow Description document of the workflow specified by its identifier. The status of the workflow should be SUSPENDED or INITIATED.

Specified by:
setWorkflowDescription in interface GWES
Parameters:
workflowID - The unique workflow identifier.
gworkflowdl - The GWorkflowDL description of the workflow.
Throws:
NoSuchWorkflowException
StateTransitionException
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
RemoteException

getStatus

public int getStatus(String workflowID,
                     String userID)
              throws NoSuchWorkflowException,
                     RemoteException,
                     DatabaseException
Description copied from interface: GWES
Get the current status code of the workflow specified by its identifier. Valid codes are:
  • STATUS_UNDEFINED = 0
  • STATUS_INITIATED = 1
  • STATUS_RUNNING = 2
  • STATUS_SUSPENDED = 3
  • STATUS_ACTIVE = 4
  • STATUS_TERMINATED = 5
  • STATUS_COMPLETED = 6

    Specified by:
    getStatus in interface GWES
    Parameters:
    workflowID - The unique workflow identifier.
    Returns:
    The current state of the workflow.
    Throws:
    NoSuchWorkflowException
    RemoteException
    DatabaseException

  • waitForStatusChangeFrom

    public int waitForStatusChangeFrom(String workflowID,
                                       int oldStatus,
                                       String userID)
                                throws NoSuchWorkflowException,
                                       RemoteException,
                                       InterruptedException
    Description copied from interface: GWES
    Wait for workflow to change its status from an specified status.

    Specified by:
    waitForStatusChangeFrom in interface GWES
    Parameters:
    workflowID - The workflow identifier
    oldStatus - The old status of the workflow
    Returns:
    the new status
    Throws:
    NoSuchWorkflowException
    RemoteException
    InterruptedException

    waitForStatusChangeToCompletedOrTerminated

    public int waitForStatusChangeToCompletedOrTerminated(String workflowID,
                                                          String userID)
                                                   throws NoSuchWorkflowException,
                                                          RemoteException,
                                                          InterruptedException
    Description copied from interface: GWES
    Wait for workflow to change its status to final states COMPLETED or TERMINATED.

    Specified by:
    waitForStatusChangeToCompletedOrTerminated in interface GWES
    Parameters:
    workflowID - The workflow identifier
    Returns:
    the new status
    Throws:
    NoSuchWorkflowException
    RemoteException
    InterruptedException

    getWorkflowIDs

    public String[] getWorkflowIDs(int level,
                                   String userID)
                            throws DatabaseException,
                                   RemoteException
    Description copied from interface: GWES
    Get the identifiers of all the workflows that are handled by this Generic Workflow Execution Service. The level denotes from where to get the workflow IDs:
  • level = 1: workflows handled in main memory
  • level = 2: workflows stored in workflow database
  • level = 3: workflows handled in main memory AND stored in workflow database

    Specified by:
    getWorkflowIDs in interface GWES
    Parameters:
    level - The level from where to get the workflowIDs.
    Returns:
    An array of strings with the workflowIDs.
    Throws:
    DatabaseException
    RemoteException

  • getWorkflowStatusArray

    public String[][] getWorkflowStatusArray(int level,
                                             String userID)
                                      throws DatabaseException,
                                             RemoteException
    Description copied from interface: GWES
    Get the workflow status of all currently available workflows. Example for each workflow:
     "ID=hoheisel_f2968050-1d6a-11db-bacc-ad353bc1f9b1"
     "status=COMPLETED"
     "birthdayMs=1154003111126"
     "durationUndefinedMs=527"
     "durationInitiatedMs=792"
     "durationRunningMs=0"
     "durationActiveMs=0"
     "durationSuspendedMs=0"
     "durationTotalMs=1351"
     "endTimeMs=1154003112477"
     "level=MEMORY"
     "description=test workflow"
     

    The level denotes from where to get the workflow IDs:

  • level = 1: workflows handled in main memory
  • level = 2: workflows stored in workflow database
  • level = 3: workflows handled in main memory AND stored in workflow database

    Specified by:
    getWorkflowStatusArray in interface GWES
    Parameters:
    level - The level from where to get the workflowIDs.
    Returns:
    The current workflow status as an array of string arrays
    Throws:
    DatabaseException
    RemoteException

  • store

    public String store(String workflowID,
                        String userID)
                 throws NoSuchWorkflowException,
                        DatabaseException,
                        RemoteException
    Description copied from interface: GWES
    Store a workflow in the XML workflow database. If the workflow is running or active, then the GWES first suspends the workflow, second it stores the workflow description in the database, and third it resumes the workflow. The workflow can be restored using the restore method.

    Specified by:
    store in interface GWES
    Parameters:
    workflowID - The unique workflow identifier.
    Returns:
    An identifier within the XML database where the workflow is stored
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    DatabaseException - If there is a problem with the XML database
    RemoteException
    See Also:
    GWES.restore(String,String)

    restore

    public String restore(String workflowID,
                          String userID)
                   throws NoSuchWorkflowException,
                          net.kwfgrid.gworkflowdl.structure.WorkflowFormatException,
                          DatabaseException,
                          StateTransitionException,
                          RemoteException
    Description copied from interface: GWES
    Restores a workflow from the XML database. If the input is the clean workflowID (without version number), then the GWES will restore the latest available workflow snapshot. If the workflowID string contains the whole XML database collection identifier, then the GWES will restore the given workflow (e.g. /db/gworkflowdl/[workflowID]/0000000221.xml. The method call returns the new workflow ID of the restored workflow.

    A restored workflow has the status INITIATED and needs to be started using the start() method.

    Workflows are stored, e.g., by using the store method.

    Specified by:
    restore in interface GWES
    Parameters:
    workflowID - The old workflow ID of the stored workflow.
    userID - The user ID.
    Returns:
    The new workflow ID of the restored workflow.
    Throws:
    NoSuchWorkflowException
    net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
    DatabaseException
    StateTransitionException
    RemoteException
    See Also:
    GWES.store(String, String), GWES.start(String, String)

    getData

    public String[] getData(String workflowID,
                            String placeID,
                            String userID)
                     throws NoSuchWorkflowException,
                            RemoteException,
                            DatabaseException
    Description copied from interface: GWES
    Get some data that is hold inside a specific workflow and that is referenced by a data place identifier. The format of the place identifier may differ depending on the implementation of the workflow handler. An other alternative to get the data hold by the workflow is to retrieve to whole workflow description.

    Specified by:
    getData in interface GWES
    Parameters:
    workflowID - The workflow identifier
    placeID - The place identifier that refers to the data
    Returns:
    The data as an array of Strings.
    Throws:
    NoSuchWorkflowException
    RemoteException
    DatabaseException

    setDescription

    public void setDescription(String workflowID,
                               String description,
                               String userID)
                        throws NoSuchWorkflowException,
                               RemoteException,
                               DatabaseException
    Description copied from interface: GWES
    Set the human-readable description for a specific workflow. If the description already exists it will be replaced by the new description.

    Specified by:
    setDescription in interface GWES
    Parameters:
    workflowID - The workflow identifier
    description - The human-readable description
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    DatabaseException
    RemoteException

    getDescription

    public String getDescription(String workflowID,
                                 String userID)
                          throws NoSuchWorkflowException,
                                 RemoteException,
                                 DatabaseException
    Description copied from interface: GWES
    Get the human-readable description for a specific workflow.

    Specified by:
    getDescription in interface GWES
    Parameters:
    workflowID - The workflow identifier
    Returns:
    The human-readable description
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    DatabaseException
    RemoteException

    setProperty

    public void setProperty(String workflowID,
                            String name,
                            String value,
                            String userID)
                     throws NoSuchWorkflowException,
                            RemoteException,
                            DatabaseException
    Description copied from interface: GWES
    Set the value of a specific workflow property. If a property with the same name already exists in this worklfow, the old property value will be replaced by the new one.

    Specified by:
    setProperty in interface GWES
    Parameters:
    workflowID - The workflow identifier
    name - Name of the property
    value - Value of the property
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    RemoteException
    DatabaseException

    getProperty

    public String getProperty(String workflowID,
                              String name,
                              String userID)
                       throws NoSuchWorkflowException,
                              RemoteException,
                              DatabaseException
    Description copied from interface: GWES
    Get the value of a specific workflow property.

    Specified by:
    getProperty in interface GWES
    Parameters:
    workflowID - The workflow identifier
    name - Name of the property
    Returns:
    Value of the property
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    RemoteException
    DatabaseException

    getProperties

    public String[][] getProperties(String workflowID,
                                    String userID)
                             throws NoSuchWorkflowException,
                                    RemoteException,
                                    DatabaseException
    Description copied from interface: GWES
    Get all propertries of a specific workflow. The properties are encoded in a two dimensional String array containing the name and the value for each property. Example:
     properties = getProperties(workflowID);
     properties[0][0] //Name of the first workflow property
     properties[0][1] //Value of the first workflow property
     properties[1][0] //Name of the second worklfow property
     properties[1][1] //Value of the second workflow property
     

    Specified by:
    getProperties in interface GWES
    Returns:
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    RemoteException
    DatabaseException

    getCheckpoints

    public String[] getCheckpoints(String workflowID,
                                   String userID)
                            throws NoSuchWorkflowException,
                                   RemoteException,
                                   DatabaseException
    Description copied from interface: GWES
    Get the path of all available checkpoints for a specific workflow.

    Specified by:
    getCheckpoints in interface GWES
    Parameters:
    workflowID - The workflow identifier.
    Returns:
    A String array containing the checkpoint paths.
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    DatabaseException
    RemoteException

    remove

    public void remove(String workflowID,
                       int level,
                       String userID)
                throws NoSuchWorkflowException,
                       DatabaseException,
                       RemoteException
    Description copied from interface: GWES
    Remove a specific workflow from memory, database, and/or its temporary data on the Grid nodes. The level denotes from where to remove the workflow:
  • level = 1: main memory
  • level = 2: workflow database
  • level = 3: main memory AND workflow database
  • level = 4: temporary data on Grid nodes
  • level = 5: main memory AND temporary data on Grid nodes
  • level = 6: workflow database AND temporary data on Grid nodes
  • level = 7: main memory AND workflow database AND temporary data on Grid nodes

    Specified by:
    remove in interface GWES
    Parameters:
    workflowID - The workflow identifier.
    level - From where to remove the workflow data.
    userID - The user ID.
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    DatabaseException
    RemoteException

  • getActivityStatusArray

    public String[][] getActivityStatusArray(String workflowID,
                                             String userID)
                                      throws NoSuchWorkflowException,
                                             RemoteException
    Description copied from interface: GWES
    Get the status array of all instantiated activities of a given workflow. Example String array for one activity:
     ID=hoheisel_2addc790-416a-11de-97f3-9cdc141524de_0000000025
     status=ACTIVE
     activityClass=net.kwfgrid.gwes.wsgramactivity.GRAMActivity
     operationName=software:makeload100
     resourceName=hardware:quadro.first.fhrg.fraunhofer.de
     timeoutActive=7200000
     timeoutRunning=86400000
     birthdayMs=1242403824742
     durationUndefinedMs=1
     durationInitiatedMs=1
     durationRunningMs=1886
     durationActiveMs=0
     durationSuspendedMs=0
     durationTotalMs=0
     endTimeMs=0
         

    Specified by:
    getActivityStatusArray in interface GWES
    Parameters:
    workflowID - The workflow identifier.
    Returns:
    The current activity status as an array of string arrays
    Throws:
    NoSuchWorkflowException - If the workflow identifier is unknown to this GWES.
    RemoteException

    getAvailableResources

    public String[] getAvailableResources(String ofClass,
                                          String userID)
                                   throws DatabaseException,
                                          RemoteException
    Description copied from interface: GWES
    Get a list of all available resources. The information is returned in an Array of XML Strings: Example:
     String[] resources = getAvailableResources("urn:dgrdl:software");
     resources[0]=
     <resource>
       <uri>software:cat-fhrg</uri>                     // Operation URI
       <classUri>urn:dgrdl:software:cat</classUri>      // Operation Class URI (workflow: operationClass name="...")
       <name>cat</name>                                 // Operation Name
       <description>Program that concatenates two files<description> // Operation Description
     </resource>
     

    Specified by:
    getAvailableResources in interface GWES
    Parameters:
    ofClass - The class which this resource should be part of. This method only checkes whether the class starts with the given ofClass parameter, e.g., "urn:dgrdl:software" would match both classes: "urn:dgrdl:software:A" as well as "urn:dgrdl:software:B". If ofClass is null then all classes of resources are returned.
    Returns:
    The list of resources of a certain class as array of XML strings.
    Throws:
    DatabaseException
    RemoteException

    getResourceDescription

    public String getResourceDescription(String resourceUri,
                                         String userID)
                                  throws DatabaseException,
                                         RemoteException
    Description copied from interface: GWES
    Get the resource description of a specific resource in D-GRDL syntax.

    Specified by:
    getResourceDescription in interface GWES
    Parameters:
    resourceUri - The resource URI.
    Returns:
    A String which contains the D-GRDL document of the resource.
    Throws:
    DatabaseException
    RemoteException


    Copyright © 2005-2011 Fraunhofer FIRST. All Rights Reserved.