Class AbstractScriptCommand
- java.lang.Object
-
- org.codehaus.cargo.container.configuration.script.AbstractScriptCommand
-
- All Implemented Interfaces:
ScriptCommand
- Direct Known Subclasses:
AbstractResourceScriptCommand,CustomWildFlyScriptCommand,FileScriptCommand
public abstract class AbstractScriptCommand extends Object implements ScriptCommand
Implementation of general functionality for configuration script commands.
-
-
Constructor Summary
Constructors Constructor Description AbstractScriptCommand(Configuration configuration)Sets configuration containing all needed information for building configuration scripts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringescapeDeployableName(String name)Removes all special characters from a deployable name, to make a "safe" identifier.protected ConfigurationgetConfiguration()booleanisApplicable()Method used for checking if script command can be applied - if it has all needed parameters set.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.cargo.container.configuration.script.ScriptCommand
readScript
-
-
-
-
Constructor Detail
-
AbstractScriptCommand
public AbstractScriptCommand(Configuration configuration)
Sets configuration containing all needed information for building configuration scripts.- Parameters:
configuration- Container configuration.
-
-
Method Detail
-
isApplicable
public boolean isApplicable()
Method used for checking if script command can be applied - if it has all needed parameters set.- Specified by:
isApplicablein interfaceScriptCommand- Returns:
- True if script command can be applied with existing parameters.
-
getConfiguration
protected Configuration getConfiguration()
- Returns:
- Container configuration.
-
escapeDeployableName
protected String escapeDeployableName(String name)
Removes all special characters from a deployable name, to make a "safe" identifier.- Parameters:
name- Deployable name.- Returns:
- "Safe" version of the deployable name, where:
- Empty or
nullnames are rewritten asROOT - Else, from yhe name, everything outside the base alphabet, numbers,
-and_are changed into_.
- Empty or
-
-