Generated: Sun Oct 7 15:19:11 BST 2007

org.embl.ebi.SoaplabServer.gowlab
Interface RunPlugIn

All Known Implementing Classes:
RunPlugInBaseImpl, RunPlugInDefaultImpl, RunPlugInExternalImpl, RunPlugInXSLTImpl

public interface RunPlugIn

An interface defining behaviour of Gowlab-aware plugins that are able to fetch data from remote web sites. The interface is implemented by specialized plugin-classes in cases where fetching data needs more than just connect-and-fetch. For example:

Note that this interface is not meant to be used for post-processing of results. It can do that, as well, but if you need just to parse resulting data and convert them into something else, implement rather DataAdaptPlugIn interface.

Version:
$Id: RunPlugIn.java,v 1.1.1.1 2005/06/15 09:00:19 marsenger Exp $
Author:
Martin Senger

Field Summary
static java.lang.String DEBUG
          Property name.
static java.lang.String METHOD_GET
          An allowed value of the property PREFERRED_METHOD.
static java.lang.String METHOD_POST
          An allowed value of the property PREFERRED_METHOD.
static java.lang.String PREFERRED_METHOD
          Property name.
static java.lang.String RESULT_NAMES
          Property name.
static java.lang.String SERVICE_NAME
          Property name.
static java.lang.String XSLT_DIR
          Property name.
static java.lang.String XSLT_FILE
          Property name.
 
Method Summary
 void fetch(HTTPClient.HTTPConnection con, HTTPClient.URI supplierURI, HTTPClient.NVPair[] formData, HTTPClient.NVPair[] files)
          Send given data to a site using given connection, wait for an answer, and store results into given Result Manager.
 void setEventManager(org.embl.ebi.analysis.EventManager eventManager)
          Set an Event Manager where this instance will report about the fetching.
 void setProperties(java.util.Properties analysisProps)
          Set additional properties that can be useful during fetching data.
 void setResultManager(org.embl.ebi.analysis.ResultManager resultManager)
          Set a Result Manager where this instance will store fetched data, and where it will report about a success or failure.
 

Field Detail

DEBUG

static final java.lang.String DEBUG
Property name. Its true value sets debugging mode that can be used in plug-ins.

See Also:
Constant Field Values

PREFERRED_METHOD

static final java.lang.String PREFERRED_METHOD
Property name. Its value indicates what HTTP method should be used to access the remote site. Available values are defined as METHOD_GET and METHOD_POST. Note that this property is only a suggestion not a rule - the implementtaion may know better how to deal with a particular web site.

See Also:
Constant Field Values

METHOD_GET

static final java.lang.String METHOD_GET
An allowed value of the property PREFERRED_METHOD.

See Also:
Constant Field Values

METHOD_POST

static final java.lang.String METHOD_POST
An allowed value of the property PREFERRED_METHOD.

See Also:
Constant Field Values

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Property name. Its value tells the name of the service/analysis that is being executed. The property may be given to fetch(HTTPClient.HTTPConnection, HTTPClient.URI, HTTPClient.NVPair[], HTTPClient.NVPair[]) method in order to use it in reports or log messages, or simila.

See Also:
Constant Field Values

RESULT_NAMES

static final java.lang.String RESULT_NAMES
Property name. Its value contains a comma-separated list of result names that should be created.

An example how this property can be used is shown in the default implementation of this interface (RunPlugInDefaultImpl.

See Also:
Constant Field Values

XSLT_FILE

static final java.lang.String XSLT_FILE
Property name. Its value contains a fully qualified filename with an XSLT definition that can be used to transform fetched pages.

An example how this property can be used is shown in the implementation of this interface (RunPlugInXSLTImpl.

See Also:
Constant Field Values

XSLT_DIR

static final java.lang.String XSLT_DIR
Property name. Its value contains a fully qualified directory with XSLT definition files that can be used to transform fetched pages.

An example how this property can be used is shown in the implementation of this interface (RunPlugInXSLTImpl.

See Also:
Constant Field Values
Method Detail

setResultManager

void setResultManager(org.embl.ebi.analysis.ResultManager resultManager)
Set a Result Manager where this instance will store fetched data, and where it will report about a success or failure.

Parameters:
resultManager - to be set

setEventManager

void setEventManager(org.embl.ebi.analysis.EventManager eventManager)
Set an Event Manager where this instance will report about the fetching.

Parameters:
eventManager - to be set

setProperties

void setProperties(java.util.Properties analysisProps)
Set additional properties that can be useful during fetching data. Some of the recognized property names are defined elswhere in this interface.

Parameters:
analysisProps - poperties to be set

fetch

void fetch(HTTPClient.HTTPConnection con,
           HTTPClient.URI supplierURI,
           HTTPClient.NVPair[] formData,
           HTTPClient.NVPair[] files)
Send given data to a site using given connection, wait for an answer, and store results into given Result Manager. Optionally report fetching progress using given Event Manager.

It does not throw any exception - instead it reports all problems to the ResultManager (setReport() and addToReport() methods). It also indicates success or failure by reporting an appropriate state to the ResultManager (setStatusResult() method).

Parameters:
con - is an open connection to a site where to go
formData - are named values representing input data to be sent (usually they correspond to data sent from an HTML form if the page is accessed manually). Parameter may be null.

Sometimes it is expected to send a query string instead of name/value pairs of data. This is simulated by using 'formData' with only one element, whose 'name' part is null. The 'value' part is used as a query string.

files - represents files to be uploaded (together with the 'formData' they consitute full input data set). The data will be sent using multipart/form-data encoding. Each pair represents one file - the name refers to the 'name' attribute to be used in the header of the part, and the value is the actual filename (the file will be read and it's contents put in the body of that part). Parameter may be null.

Generated: Sun Oct 7 15:19:11 BST 2007

Submit a bug or feature
Generated: Sun Oct 7 15:19:11 BST 2007