public class PluginScripts extends AbstractPluginValue
If scripts are expected to be relative to classpath, set 'classpathrelative' attribute to true, or add the 'FEATURE_CLASSPATH_RELATIVE' to true.
| Modifier and Type | Field and Description |
|---|---|
protected static ThreadLocal<ICache<String,String>> |
cache
Cache of scripts.
|
static boolean |
DEFAULT_CLASSPATH_RELATIVE
Default classpath relative.
|
static String |
DEFAULT_NAME_SEPARATOR
Default name separator.
|
static String |
FEATURE_CLASSPATH_RELATIVE
Feature for classpath relative scripts.
|
static String |
FEATURE_FAILSAFE
Fail safe feature means that on command execution command errors will not
raise errors but warnings instead.
|
static String |
FEATURE_NAME_SEPARATOR
Feature for names separators.
|
static String |
FEATURE_SCRIPT_SEPARATOR
Sets the script separator on specification.
|
static String |
FEATURE_SQL_SEPARATOR
Sets the SQL command separator.
|
eval, valuescopenameFEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_NORMALIZER, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAITparameters| Constructor and Description |
|---|
PluginScripts() |
| Modifier and Type | Method and Description |
|---|---|
ENext |
doStart(IContext context,
IResultSet result) |
protected int |
execute(Statement stmt,
String sql,
IContext context,
IResultSet result)
Perform a command, and return the number of errors in execution.
|
ActionType |
getActionType() |
Boolean |
getFailsafe()
Set if commands execution should report errors or warning on command
execution failure.
|
String |
getNameseparator()
Get the name separator.
|
URI[] |
getScripts()
List of scripts as URIs.
|
String |
getScriptseparator()
Return the script separator token.
|
String |
getSqlseparator()
The SQL commands separator.
|
void |
initialize(IContext context) |
boolean |
isClasspathrelative()
Get if script is classpath relative or not.
|
protected int |
perform(IContext context,
IResultSet result,
Connection connection,
String reference,
Reader script,
boolean fromCache)
Perform script commands.
|
void |
setClasspathrelative(boolean classpathrelative)
Set classpath relative script flag.
|
void |
setFailsafe(Boolean failsafe)
Set fail safe status.
|
void |
setNameseparator(String nameseparator)
Set the name separator.
|
protected void |
setScripts(IContext context)
Set script, if necessary.
|
void |
setScripts(URI[] scripts)
Set scripts.
|
void |
setScriptseparator(String scriptseparator)
Set script separator.
|
void |
setSqlseparator(String sqlseparator)
Sets the SQL command separators.
|
getValue, getValue, isEval, setEval, setValuegetScope, saveGlobal, saveLocal, saveStrict, setScopegetName, setNamecopy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getNormalizer, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setNormalizer, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toStringgetParameters, setParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameters, setParametersprotected static ThreadLocal<ICache<String,String>> cache
public static final String FEATURE_SCRIPT_SEPARATOR
public static final String FEATURE_SQL_SEPARATOR
public static final String FEATURE_NAME_SEPARATOR
public static final String DEFAULT_NAME_SEPARATOR
public static final String FEATURE_CLASSPATH_RELATIVE
public static final boolean DEFAULT_CLASSPATH_RELATIVE
public static final String FEATURE_FAILSAFE
public URI[] getScripts()
public void setScripts(URI[] scripts)
scripts - The scripts.public String getScriptseparator()
public void setScriptseparator(String scriptseparator)
scriptseparator - The separator.public String getSqlseparator()
public void setSqlseparator(String sqlseparator)
sqlseparator - Separator.public String getNameseparator()
public void setNameseparator(String nameseparator)
nameseparator - The separator.public boolean isClasspathrelative()
public void setClasspathrelative(boolean classpathrelative)
classpathrelative - true, to set classpath relative, false, otherwise.public Boolean getFailsafe()
public void setFailsafe(Boolean failsafe)
failsafe - Fail safe status.public ActionType getActionType()
public void initialize(IContext context) throws PluginException
initialize in interface IPlugininitialize in class AbstractPluginPluginExceptionprotected void setScripts(IContext context) throws PluginException
context - The context.PluginException - On error.public ENext doStart(IContext context, IResultSet result) throws PluginException
doStart in interface IPlugindoStart in class AbstractPluginPluginExceptionprotected int perform(IContext context, IResultSet result, Connection connection, String reference, Reader script, boolean fromCache) throws SQLException
context - The context.result - The result.connection - Database connection.reference - Script reference as string.script - Script content.fromCache - Indicates if reader comes from cache or not.SQLException - On SQL errors, only if fail safe is off.protected int execute(Statement stmt, String sql, IContext context, IResultSet result)
stmt - A statement.sql - A command.context - A text context.result - A result set.Copyright © 2017. All rights reserved.