Version: ${maven.project.version}

org.soaplab.services.adaptor
Interface DataAdaptor


public interface DataAdaptor

An interface for adapting (changing, filtering) analysis input and output data.

The implementation classes will be loaded dynamically - therefore they should have a non-arg constructor.

Version:
$Id: DataAdaptor.java,v 1.3 2007/10/26 16:40:51 marsenger Exp $
Author:
Martin Senger

Method Summary
 void process(java.lang.String dataName, java.io.InputStream source, java.io.OutputStream result, Job job)
          Read 'source' data, adapt them, and write them back into 'result'.
 java.lang.Object processFromList(java.lang.String dataName, java.util.List source, Job job)
          Read 'source' data, adapt them, and return them back.
 

Method Detail

process

void process(java.lang.String dataName,
             java.io.InputStream source,
             java.io.OutputStream result,
             Job job)
             throws java.io.IOException,
                    SoaplabException
Read 'source' data, adapt them, and write them back into 'result'. The adapting process can benefit from knowing what input or output element is adapted ('dataName') and from the full metadata of the given service ('metadataAccessor').

Parameters:
dataName - identifies what data are being adapted; this is usually a parameter or result name (as defined in the service metadata).

source - data to be adapted (read, processed). The adaptor is supposed to close this source stream after reading it.

result - data to be produced. The adaptor does not need to close this result stream before returning back - but it can do it.

job - - the adapting process can benefit from knowing what jobs calls it (e.g. because of access to the service metadata)

Throws:
java.io.IOException - if there were 'physical' problems with reading or writing data

SoaplabException - if there were 'logical' problems (for example, an unexpected source format, or missing pieces in the source data)

processFromList

java.lang.Object processFromList(java.lang.String dataName,
                                 java.util.List source,
                                 Job job)
                                 throws java.io.IOException,
                                        SoaplabException
Read 'source' data, adapt them, and return them back. This method can be used to combine a list of inputs into another list or array, or to a merged object.

Parameters:
dataName - identifies what data are being adapted; this is usually a parameter or result name (as defined in the service metadata).

source - data to be adapted (read, processed).

job - - the adapting process can benefit from knowing what jobs calls it (e.g. because of access to the service metadata)

Returns:
adapted data (never null); it can be again an array or list, or just a merged object

Throws:
java.io.IOException - if there were 'physical' problems with reading or writing data

SoaplabException - if there were 'logical' problems (for example, an unexpected source format, or missing pieces in the source data)

Version: ${maven.project.version}

Submit a bug or feature
Generated: Tue Jun 14 15:18:14 AST 2011