|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.ncl.cs.instantsoap.commandlineprocessor.CommandLineProcessor
public class CommandLineProcessor
A MapProcessor that executes command-line applications.
This is configured with a collection of application descriptors. Given an input, it finds one with a name that matches the job application name and executes it via the command-line.
| Constructor Summary | |
|---|---|
CommandLineProcessor(CommandExecutionStrategy commandExecutionStrategy,
ParameterRenamer parameterRenamer,
CommandFormatter commandFormatter)
Construct a new command line processor with the specified configuration objects. |
|
| Method Summary | |
|---|---|
void |
addApplication(Application app)
Add an application. |
MetaData |
describeApplication(String application)
Describe an application. |
Application |
getApplication(String appName)
Get an application by name. |
Set<MetaData> |
getInputs(String application)
Get the inputs assocaited with an application. |
Set<MetaData> |
getOutputs(String application)
Get the outputs assocaited with an application. |
Map<String,Application> |
getRegisteredApps()
|
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 |
removeApplication(String appName)
Remove an application by name. |
void |
validate(String application,
Map<String,String> inputs)
Validate the inputs for the application. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandLineProcessor(CommandExecutionStrategy commandExecutionStrategy,
ParameterRenamer parameterRenamer,
CommandFormatter commandFormatter)
commandExecutionStrategy - the CommandExecutionStrategy that
will be used to run command linesparameterRenamer - the ParameterRenamer encapsulating the rules
for mapping between external and internal input and output namescommandFormatter - the CommandFormatter that is able to
produce functioning command-line strings| Method Detail |
|---|
public Map<String,String> process(String application,
Map<String,String> inputs)
throws JobExecutionException,
UnknownApplicationException
MapProcessor
process in interface MapProcessorapplication - the name of the applicationinputs - the input Map
JobExecutionException
UnknownApplicationException
public void addApplication(Application app)
throws ApplicationConfigurationException
app - the Application to add
ApplicationConfigurationException - if the application failed validation or an application with the same
name is already present.
public Application getApplication(String appName)
throws UnknownApplicationException
appName - the name of the application to fetch
UnknownApplicationException - if there is no application known by appName
public void removeApplication(String appName)
throws UnknownApplicationException
appName - the name of the Application to remove
UnknownApplicationException - if appName doesn't correspond to a registered application
public void validate(String application,
Map<String,String> inputs)
throws InvalidJobSpecificationException
MapProcessor
validate in interface MapProcessorapplication - the name of the applicationinputs - the Map of input values
InvalidJobSpecificationExceptionpublic boolean handlesApplication(String application)
MapProcessorlistApplicaionts.
handlesApplication in interface MapProcessorapplication - the name of the application to be checked
public List<String> listApplications()
MapProcessor
listApplications in interface MapProcessorList of handled applications
public MetaData describeApplication(String application)
throws UnknownApplicationException
MapProcessor
describeApplication in interface MapProcessorapplication - the name of the application
MetaData with the name matching application
providing the description and semantic annotation for this application
UnknownApplicationException
public Set<MetaData> getInputs(String application)
throws UnknownApplicationException
MapProcessor
getInputs in interface MapProcessorapplication - the name of the application
Set of MetaData
instances
UnknownApplicationException
public Set<MetaData> getOutputs(String application)
throws UnknownApplicationException
MapProcessor
getOutputs in interface MapProcessorapplication - the name of the application
Set of MetaData
instances
UnknownApplicationExceptionpublic Map<String,Application> getRegisteredApps()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||