org.yawlfoundation.yawl.cost.interfce
Class CostGatewayClient

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.Interface_Client
      extended by org.yawlfoundation.yawl.cost.interfce.CostGatewayClient
Direct Known Subclasses:
CostClient

public class CostGatewayClient
extends Interface_Client

An API to be used by clients that want to retrieve data from the cost service.

Author:
Michael Adams 11/07/2011

Field Summary
protected  String _costURI
          the uri of the YAWL Cost Service a default would be "http://localhost:8080/costService/"
 
Constructor Summary
CostGatewayClient()
           
CostGatewayClient(String uri)
          the constructors
 
Method Summary
 String checkConnection(String handle)
          Check that a session handle is active
 String connect(String userID, String password)
          Connects an external entity to the cost service
 void disconnect(String handle)
          Disconnects an external entity from the cost service
 String getAnnotatedLog(YSpecificationID specID, boolean withData, String handle)
           
 String getFixedCosts(YSpecificationID specID, String taskName, String handle)
          Gets an XML list of all the fixed costs for the specified specification - task combination.
 String getFunctionList(YSpecificationID specID, String taskName, String handle)
          Gets an XML list of all cost functions for the specified specification - task combination.
 String getResourceCosts(YSpecificationID specID, String taskName, Set<String> resources, String handle)
           
 String getResourceCosts(YSpecificationID specID, String taskName, String resources, String handle)
          Gets the cost of performing an activity for each resource in a Set.
 String importModel(String modelXML, String handle)
           
 void setURI(String uri)
           
 
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

_costURI

protected String _costURI
the uri of the YAWL Cost Service a default would be "http://localhost:8080/costService/"

Constructor Detail

CostGatewayClient

public CostGatewayClient(String uri)
the constructors

Parameters:
uri - the uri of the YAWL Cost Service

CostGatewayClient

public CostGatewayClient()
Method Detail

setURI

public void setURI(String uri)

connect

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

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 String checkConnection(String handle)
                       throws IOException
Check that a session handle is active

Parameters:
handle - the session handle to check
Returns:
"true" if the id is valid, "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 cost service

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

importModel

public String importModel(String modelXML,
                          String handle)
                   throws IOException
Parameters:
modelXML -
handle - a current sessionhandle to the cost service
Returns:
Throws:
IOException

getAnnotatedLog

public String getAnnotatedLog(YSpecificationID specID,
                              boolean withData,
                              String handle)
                       throws IOException
Parameters:
specID -
withData -
handle - a current sessionhandle to the cost service
Returns:
Throws:
IOException

getFunctionList

public String getFunctionList(YSpecificationID specID,
                              String taskName,
                              String handle)
                       throws IOException
Gets an XML list of all cost functions for the specified specification - task combination.

Parameters:
specID - the specification identifier
taskName - the task identifier (may be null, in which case only the case level functions are required)
handle - a current sessionhandle to the cost service
Returns:
an XML list of the cost functions requested, or an appropriate failure message.
Throws:
IOException - if there's a problem connecting to the service

getFixedCosts

public String getFixedCosts(YSpecificationID specID,
                            String taskName,
                            String handle)
                     throws IOException
Gets an XML list of all the fixed costs for the specified specification - task combination.

Parameters:
specID - the specification identifier
taskName - the task identifier (may be null, in which case only the case level costs are required)
handle - a current sessionhandle to the cost service
Returns:
an XML list of the costs requested, or an appropriate failure message.
Throws:
IOException - if there's a problem connecting to the service

getResourceCosts

public String getResourceCosts(YSpecificationID specID,
                               String taskName,
                               String resources,
                               String handle)
                        throws IOException
Gets the cost of performing an activity for each resource in a Set.

Parameters:
specID - the specification identifier
taskName - the task name (may be null, in which case only the case level costs are required)
resources - an XML document containing participant ids
handle - a current sessionhandle to the cost service
Returns:
an XML document containing the actual result of applying the costParams to the relevant cost functions.
Throws:
IOException - if there's a problem connecting to the service

getResourceCosts

public String getResourceCosts(YSpecificationID specID,
                               String taskName,
                               Set<String> resources,
                               String handle)
                        throws IOException
Parameters:
specID - the specification identifier
taskName - the task name
resources - the set of participant ids to get costs for
handle - a current sessionhandle to the cost service
Returns:
Throws:
IOException


Copyright © 2004-2012 The YAWL Foundation.