com.dtolabs.rundeck.core.plugins
Class BaseScriptPlugin

java.lang.Object
  extended by com.dtolabs.rundeck.core.plugins.AbstractDescribableScriptPlugin
      extended by com.dtolabs.rundeck.core.plugins.BaseScriptPlugin
All Implemented Interfaces:
Describable

public abstract class BaseScriptPlugin
extends AbstractDescribableScriptPlugin

BaseScriptPlugin provides common methods for running scripts, used by the script plugin implementations.


Field Summary
 
Fields inherited from class com.dtolabs.rundeck.core.plugins.AbstractDescribableScriptPlugin
CONFIG_DEFAULT, CONFIG_DESCRIPTION, CONFIG_NAME, CONFIG_PROP_PREFIX, CONFIG_REQUIRED, CONFIG_SCOPE, CONFIG_TITLE, CONFIG_TYPE, CONFIG_VALUES, DESCRIPTION_PROP, TITLE_PROP
 
Constructor Summary
protected BaseScriptPlugin(ScriptPluginProvider provider, Framework framework)
           
 
Method Summary
protected  java.lang.String[] createScriptArgs(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> localDataContext)
          Create the command array for the data context.
protected  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> createScriptDataContext(Framework framework, java.lang.String project, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> context)
           
protected  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> createStepItemDataContext(Framework framework, java.lang.String project, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> context, java.util.Map<java.lang.String,java.lang.Object> configuration)
          Create a data context containing the plugin values "file","scriptfile" and "base", as well as all config values.
protected  int runPluginScript(PluginStepContext executionContext, java.io.PrintStream outputStream, java.io.PrintStream errorStream, Framework framework, java.util.Map<java.lang.String,java.lang.Object> configuration)
          Runs the script configured for the script plugin and channels the output to two streams.
 
Methods inherited from class com.dtolabs.rundeck.core.plugins.AbstractDescribableScriptPlugin
createDescription, createPluginDataContext, getDescription, getFramework, getProvider, isAllowCustomProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseScriptPlugin

protected BaseScriptPlugin(ScriptPluginProvider provider,
                           Framework framework)
Method Detail

runPluginScript

protected int runPluginScript(PluginStepContext executionContext,
                              java.io.PrintStream outputStream,
                              java.io.PrintStream errorStream,
                              Framework framework,
                              java.util.Map<java.lang.String,java.lang.Object> configuration)
                       throws java.io.IOException,
                              java.lang.InterruptedException
Runs the script configured for the script plugin and channels the output to two streams.

Throws:
java.io.IOException - if any IO exception occurs
java.lang.InterruptedException - if interrupted while waiting for the command to finish

createStepItemDataContext

protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> createStepItemDataContext(Framework framework,
                                                                                                                     java.lang.String project,
                                                                                                                     java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> context,
                                                                                                                     java.util.Map<java.lang.String,java.lang.Object> configuration)
Create a data context containing the plugin values "file","scriptfile" and "base", as well as all config values.


createScriptDataContext

protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> createScriptDataContext(Framework framework,
                                                                                                                   java.lang.String project,
                                                                                                                   java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> context)

createScriptArgs

protected java.lang.String[] createScriptArgs(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> localDataContext)
Create the command array for the data context.