eu.scape_project.pit.invoke
Class Processor
java.lang.Object
eu.scape_project.pit.invoke.Processor
- Direct Known Subclasses:
- Convert, Identify
public class Processor
- extends Object
- Author:
- Andrew Jackson
Method Summary |
static Processor |
createProcessor(String toolspec_id,
String action_id)
Factory method to create a processor from toolspec and action identifiers, |
void |
execute(HashMap<String,String> parameters)
Generic invocation method: |
void |
execute(In input,
HashMap<String,String> parameters)
|
void |
execute(In input1,
In input2,
HashMap<String,String> parameters)
|
void |
execute(In input,
Out output,
HashMap<String,String> parameters)
|
static Action |
findTool(ToolSpec ts,
String command_id)
|
HashMap<String,String> |
getInputs()
|
protected HashMap<String,String> |
getStandardVars(Action cmd)
|
boolean |
getUseStdin()
|
protected void |
replaceAll(String[] cmd_template,
HashMap<String,String> vars)
|
protected void |
runCommand(String[] cmd_template)
|
void |
setStdout(Out output)
|
String[] |
substituteTemplates(Action cmd)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ts
protected ToolSpec ts
action
protected Action action
Processor
public Processor(ToolSpec ts,
Action action)
- Constructor from a toolspec and an action
- Parameters:
ts
- action
-
createProcessor
public static Processor createProcessor(String toolspec_id,
String action_id)
throws ToolSpecNotFoundException,
CommandNotFoundException
- Factory method to create a processor from toolspec and action identifiers,
- Parameters:
toolspec_id
- action_id
-
- Returns:
- a new Processor object
- Throws:
ToolSpecNotFoundException
CommandNotFoundException
findTool
public static Action findTool(ToolSpec ts,
String command_id)
throws CommandNotFoundException
- Throws:
CommandNotFoundException
runCommand
protected void runCommand(String[] cmd_template)
throws IOException
- Throws:
IOException
substituteTemplates
public String[] substituteTemplates(Action cmd)
- Parameters:
cmd
-
- Returns:
- the commands from the Action as a string array
getStandardVars
protected HashMap<String,String> getStandardVars(Action cmd)
throws IOException
- Throws:
IOException
replaceAll
protected void replaceAll(String[] cmd_template,
HashMap<String,String> vars)
getInputs
public HashMap<String,String> getInputs()
- Returns:
- the hash map of inputs
setStdout
public void setStdout(Out output)
execute
public void execute(HashMap<String,String> parameters)
throws IOException,
CommandNotFoundException
- Generic invocation method:
- Parameters:
command_id
- parameters
-
- Throws:
IOException
CommandNotFoundException
execute
public void execute(In input,
HashMap<String,String> parameters)
throws IOException
- Parameters:
input
- parameters
-
- Throws:
IOException
getUseStdin
public boolean getUseStdin()
- Returns:
- true if using stdin
execute
public void execute(In input1,
In input2,
HashMap<String,String> parameters)
throws IOException
- Parameters:
input1
- input2
- parameters
-
- Throws:
IOException
execute
public void execute(In input,
Out output,
HashMap<String,String> parameters)
throws IOException
- Parameters:
input
- output
- parameters
-
- Throws:
IOException
Copyright © 2013. All Rights Reserved.