net.sf.pipet.api
Interface ModuleInterface

All Known Implementing Classes:
AbstractModule, DefaultModuleInterface, InputOutputModule, SimpleInputOutputModule, VersionedModule

public interface ModuleInterface

The interface of a module implementation - the entry class of a PipeT module must implement this interface.

A ModuleInterface is used to access a module, but is stateless, meaning that it does not store any configuration and it is not affected by any previous calls. A ModuleAttributes object is used to pass the module's configuration to methods which may require this.

There are several predefined classes with some generic features:

See Also:
DefaultModuleInterface, ConfigurableModuleInterface, ModuleAttributes, ModuleData

Nested Class Summary
static interface ModuleInterface.ModuleConfigurator
          Interface for module configuration.
static interface ModuleInterface.ModuleInstance
          Interface of a module instance.
 
Field Summary
static String ATT_PIPELINE_NAME
           
static ModuleInterface.ModuleConfigurator FAIL_CONFIGURATOR
           
static int UI_GUI
           
static int UI_NONINTERACTIVE
           
 
Method Summary
 ModuleInterface.ModuleInstance createInstance(ModuleData data, net.sf.qxs.messenger.Messenger logger)
          Instantiates a module to be part of a pipeline instance.
 String getAPIVersionString()
           
 String getDescription(ModuleAttributes atts)
          Returns a description of the module.
 Map<String,ParameterType<?>> getGlobalParameters(ModuleAttributes atts)
           
 Collection<String> getInputPipeNames(ModuleAttributes atts)
          Deprecated. 
 Map<String,String> getInputPipeTypes(ModuleAttributes atts)
          Returns a map with one entry for each input pipe.
 ModuleInterface.ModuleConfigurator getInstallationConfigurator(int interface_type)
          Returns a configurator.
 Collection<String> getOutputPipeNames(ModuleAttributes atts)
          Deprecated. 
 Map<String,String> getOutputPipeTypes(ModuleAttributes atts)
          Returns a map with one entry for each output pipe.
 ModuleInterface.ModuleConfigurator getPipelineConfigurator(int interface_type)
          Returns a configurator.
 Map<String,ParameterType<?>> getPipelineParameters(ModuleAttributes atts)
           
 ModuleInterface.ModuleConfigurator getRuntimeConfigurator(int interface_type)
          Returns a configurator.
 Map<String,ParameterType<?>> getRuntimeParameters(ModuleAttributes atts)
           
 String getTitle(ModuleAttributes atts)
          Returns the title (a short description) of the module.
 boolean isAvailable()
           
 

Field Detail

ATT_PIPELINE_NAME

static final String ATT_PIPELINE_NAME
See Also:
Constant Field Values

UI_NONINTERACTIVE

static final int UI_NONINTERACTIVE
See Also:
Constant Field Values

UI_GUI

static final int UI_GUI
See Also:
Constant Field Values

FAIL_CONFIGURATOR

static final ModuleInterface.ModuleConfigurator FAIL_CONFIGURATOR
Method Detail

isAvailable

boolean isAvailable()

getAPIVersionString

String getAPIVersionString()

getTitle

String getTitle(ModuleAttributes atts)
                throws ResourceException
Returns the title (a short description) of the module.

Parameters:
atts - The module data.
Throws:
ResourceException

getDescription

String getDescription(ModuleAttributes atts)
                      throws ResourceException
Returns a description of the module.

Parameters:
atts - The module data.
Throws:
ResourceException

getOutputPipeTypes

Map<String,String> getOutputPipeTypes(ModuleAttributes atts)
                                      throws ResourceException
Returns a map with one entry for each output pipe. The keys are pipe names; the values are mime types.

Parameters:
atts - The module attributes.
Throws:
ResourceException

getInputPipeTypes

Map<String,String> getInputPipeTypes(ModuleAttributes atts)
                                     throws ResourceException
Returns a map with one entry for each input pipe. The keys are pipe names; the values are mime types.

Parameters:
atts - The module data.
Throws:
ResourceException

getOutputPipeNames

@Deprecated
Collection<String> getOutputPipeNames(ModuleAttributes atts)
                                      throws ResourceException
Deprecated. 

Throws:
ResourceException

getInputPipeNames

@Deprecated
Collection<String> getInputPipeNames(ModuleAttributes atts)
                                     throws ResourceException
Deprecated. 

Throws:
ResourceException

getGlobalParameters

Map<String,ParameterType<?>> getGlobalParameters(ModuleAttributes atts)
                                                 throws ResourceException
Throws:
ResourceException

getPipelineParameters

Map<String,ParameterType<?>> getPipelineParameters(ModuleAttributes atts)
                                                   throws ResourceException
Throws:
ResourceException

getRuntimeParameters

Map<String,ParameterType<?>> getRuntimeParameters(ModuleAttributes atts)
                                                  throws ResourceException
Throws:
ResourceException

getInstallationConfigurator

ModuleInterface.ModuleConfigurator getInstallationConfigurator(int interface_type)
                                                               throws ResourceException
Returns a configurator. This configurator is callable for an installed module, regardless of the pipelines it is in.

Parameters:
interface_type - the type of user interface, which is one of: UI_NONINTERACTIVE, UI_GUI.
Returns:
a ModuleConfigurator object, or null if the module is not install-time configurable.
Throws:
ResourceException

getPipelineConfigurator

ModuleInterface.ModuleConfigurator getPipelineConfigurator(int interface_type)
                                                           throws ResourceException
Returns a configurator. This configurator is callable for a module which is embedded in a pipeline.

Parameters:
interface_type - the type of user interface, which is one of: UI_NONINTERACTIVE, UI_GUI.
Returns:
a ModuleConfigurator object, or null if the module is not pipeline configurable.
Throws:
ResourceException

getRuntimeConfigurator

ModuleInterface.ModuleConfigurator getRuntimeConfigurator(int interface_type)
                                                          throws ResourceException
Returns a configurator. This configurator is callable at runtime for an instance of a module in a pipeline, just before the pipeline is executed.

Parameters:
interface_type - the type of user interface, which is one of: UI_NONINTERACTIVE, UI_GUI.
Returns:
a ModuleInterface.ModuleConfigurator object, or null if the module is not runtime configurable.
Throws:
ResourceException

createInstance

ModuleInterface.ModuleInstance createInstance(ModuleData data,
                                              net.sf.qxs.messenger.Messenger logger)
                                              throws Exception
Instantiates a module to be part of a pipeline instance.

Parameters:
data - an object which provides access to runtime data needed by the module.
logger - a logging interface.
Returns:
a module instance, or null if the module cannot be instantiated with the given configuration.
Throws:
Exception - if an unexpected error occurred.


Copyright © 2012 VU University Amsterdam. All Rights Reserved.