uk.ac.ncl.cs.instantsoap.mapprocessor
Interface MapProcessor

All Known Implementing Classes:
CommandLineProcessor, DivMod, EchoingMapProcessor, Map2StringProcessor, MultiplexingMapProcessor, PythonProcessor

@Spi
public interface MapProcessor

An arbitrary function encapsulated as a transform from one XML document to another.

All implementations of this interface must be threadsafe. That is, they should support multiple, concurrent invocations of any combination of methods.

Author:
Cheng-Yang(Louis) Tang, Matthew Pocock

Method Summary
 MetaData describeApplication(String application)
          Describe an application.
 Set<MetaData> getInputs(String application)
          Get the inputs assocaited with an application.
 Set<MetaData> getOutputs(String application)
          Get the outputs assocaited with an application.
 boolean handlesApplication(String application)
          Indicates if this processor can handle applications with a particuar name.
 List<String> listApplications()
          List all of the applications handled, by name.
 Map<String,String> process(String application, Map<String,String> inputs)
          Handle a request.
 void validate(String application, Map<String,String> inputs)
          Validate the inputs for the application.
 

Method Detail

handlesApplication

boolean handlesApplication(String application)
Indicates if this processor can handle applications with a particuar name.

This must return true for exactly those application names listed in listApplicaionts.

Parameters:
application - the name of the application to be checked
Returns:
true if the application can be handled, false otherwise

listApplications

List<String> listApplications()
List all of the applications handled, by name.

Returns:
the List of handled applications

describeApplication

MetaData describeApplication(String application)
                             throws UnknownApplicationException
Describe an application.

Parameters:
application - the name of the application
Returns:
the MetaData with the name matching application providing the description and semantic annotation for this application
Throws:
UnknownApplicationException

process

Map<String,String> process(String application,
                           Map<String,String> inputs)
                           throws UnknownApplicationException,
                                  JobExecutionException
Handle a request.

Parameters:
application - the name of the application
inputs - the input Map
Returns:
the result of processing the request
Throws:
UnknownApplicationException
JobExecutionException

validate

void validate(String application,
              Map<String,String> inputs)
              throws InvalidJobSpecificationException,
                     UnknownApplicationException
Validate the inputs for the application.

Parameters:
application - the name of the application
inputs - the Map of input values
Throws:
InvalidJobSpecificationException
UnknownApplicationException

getInputs

Set<MetaData> getInputs(String application)
                        throws UnknownApplicationException
Get the inputs assocaited with an application.

Parameters:
application - the name of the application
Returns:
the application inputs as a Set of MetaData instances
Throws:
UnknownApplicationException

getOutputs

Set<MetaData> getOutputs(String application)
                         throws UnknownApplicationException
Get the outputs assocaited with an application.

Parameters:
application - the name of the application
Returns:
the application outputs as a Set of MetaData instances
Throws:
UnknownApplicationException


Copyright © 2006-2008. All Rights Reserved.