org.yawlfoundation.yawl.engine.interfce
Class Interface_Client

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.Interface_Client
Direct Known Subclasses:
CostGatewayClient, DocumentStoreClient, InterfaceA_EnvironmentBasedClient, InterfaceB_EngineBasedClient, InterfaceB_EnvironmentBasedClient, InterfaceX_EngineSideClient, InterfaceX_ServiceSideClient, ResourceCalendarGatewayClient, ResourceGatewayClient, ResourceGatewayServer, ResourceLogGatewayClient, WorkletEventServer, WorkletGatewayClient, WorkQueueGatewayClient, YLogGatewayClient

public class Interface_Client
extends Object

This class is used by clients and servers to execute GET and POST requests across the YAWL interfaces. Note that since v2.0up4 (12/08) all requests are sent as POSTS - increases efficiency, security and allows 'extended' chars to be included.

Author:
Lachlan Aldred Date: 22/03/2004 Time: 17:49:42, Michael Adams (refactored for v2.0, 06/2008; and again 12/2008 & 04/2010)

Constructor Summary
Interface_Client()
           
 
Method Summary
protected  String executeGet(String urlStr, Map<String,String> paramsMap)
          Executes a rerouted HTTP GET request as a POST on the specified URL
protected  String executePost(String urlStr, Map<String,String> paramsMap)
          Executes a HTTP POST request on the url specified.
protected  Map<String,String> prepareParamMap(String action, String handle)
          Initialises a map for transporting parameters - used by extending classes
protected  void setReadTimeout(int timeout)
          Set the read timeout value for future connections
protected  String stripOuterElement(String xml)
          Removes the outermost set of xml tags from a string, if any
 boolean successful(String message)
          Tests a response message for success or failure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interface_Client

public Interface_Client()
Method Detail

executePost

protected String executePost(String urlStr,
                             Map<String,String> paramsMap)
                      throws IOException
Executes a HTTP POST request on the url specified.

Parameters:
urlStr - the URL to send the POST to
paramsMap - a set of attribute-value pairs that make up the posted data
Returns:
the result of the POST request
Throws:
IOException - when there's some kind of communication problem

executeGet

protected String executeGet(String urlStr,
                            Map<String,String> paramsMap)
                     throws IOException
Executes a rerouted HTTP GET request as a POST on the specified URL

Parameters:
urlStr - the URL to send the GET to
paramsMap - a set of attribute-value pairs that make up the posted data
Returns:
the result of the request
Throws:
IOException - when there's some kind of communication problem

prepareParamMap

protected Map<String,String> prepareParamMap(String action,
                                             String handle)
Initialises a map for transporting parameters - used by extending classes

Parameters:
action - the name of the action to take
handle - the current engine session handle
Returns:
the initialised Map

setReadTimeout

protected void setReadTimeout(int timeout)
Set the read timeout value for future connections

Parameters:
timeout - the timeout value in milliseconds. A value of -1 (the default) means a read will wait indefinitely.

stripOuterElement

protected String stripOuterElement(String xml)
Removes the outermost set of xml tags from a string, if any

Parameters:
xml - the xml string to strip
Returns:
the stripped xml string

successful

public boolean successful(String message)
Tests a response message for success or failure

Parameters:
message - the response message to test
Returns:
true if the response represents success


Copyright © 2004-2012 The YAWL Foundation.