@PublicAPI public class SelectionScript extends Script<Boolean>
Modifier and Type | Field and Description |
---|---|
protected byte[] |
id_
Hash digest of the script
|
static org.apache.log4j.Logger |
logger
Loggers
|
static String |
RESULT_VARIABLE
The variable name which must be set after the evaluation
of a verifying script.
|
ARGUMENTS_NAME, DEFAULT_OUTPUT_MAX_SIZE, id, MD5, parameters, script, scriptEngineLookupName, url
Constructor and Description |
---|
SelectionScript()
ProActive needed constructor
|
SelectionScript(File file,
Serializable[] parameters)
Create a selection script from a file.
|
SelectionScript(File file,
Serializable[] parameters,
boolean dynamic)
Create a selection script from a file.
|
SelectionScript(Script<?> script,
boolean dynamic)
Create a selection script from another selection script
|
SelectionScript(String script,
String engineName)
Directly create a script with a String.
|
SelectionScript(String script,
String engineName,
boolean dynamic)
Directly create a script with a string.
|
SelectionScript(String script,
String engineName,
Serializable[] parameters,
boolean dynamic)
Directly create a script with a string.
|
SelectionScript(URL url)
Create a selection script from an URL.
|
SelectionScript(URL url,
boolean dynamic)
Create a selection script from an URL.
|
SelectionScript(URL url,
Serializable[] parameters)
Create a selection script from an URL.
|
SelectionScript(URL url,
Serializable[] parameters,
boolean dynamic)
Create a selection script from an URL.
|
SelectionScript(URL url,
String engineName)
Create a selection script from an URL.
|
SelectionScript(URL url,
String engineName,
boolean dynamic)
Create a selection script from an URL.
|
SelectionScript(URL url,
String engineName,
Serializable[] parameters)
Create a selection script from an URL.
|
SelectionScript(URL url,
String engineName,
Serializable[] parameters,
boolean dynamic)
Create a selection script from an URL.
|
Modifier and Type | Method and Description |
---|---|
void |
buildSelectionScriptId()
Build script ID.
|
boolean |
compareByteArray(byte[] array1,
byte[] array2)
Compare two arrays of bytes
|
byte[] |
digest()
Get MD5 hash value
|
boolean |
equals(Object o) |
protected String |
getDefaultScriptName() |
String |
getId()
String identifying the script.
|
protected Reader |
getReader()
The reader used to read the script.
|
protected ScriptResult<Boolean> |
getResult(Object evalResult,
Bindings bindings)
SelectionScript must give its result in the 'result_script' variable.
|
int |
hashCode() |
static int |
hashCodeFromList(List<SelectionScript> selScriptsList)
Util method to get an hashCode of a list of selection script.
|
boolean |
isDynamic()
Say if the script is static or dynamic
|
protected void |
prepareSpecialBindings(Bindings bindings)
There is no parameter to give to the selection script.
|
String |
toString()
String representation
|
createScriptEngine, digest, display, execute, execute, fetchScript, fetchScriptWithExceptionHandling, fetchUrlIfNeeded, getEngineName, getParameters, getScript, getScriptName, getScriptUrl, overrideDefaultScriptName, prepareBindings, readFile, setScript
public static final org.apache.log4j.Logger logger
public static final String RESULT_VARIABLE
protected byte[] id_
public SelectionScript()
public SelectionScript(String script, String engineName) throws InvalidScriptException
script
- String representing a script codeengineName
- String a script execution engine.InvalidScriptException
- if the creation fails.public SelectionScript(String script, String engineName, boolean dynamic) throws InvalidScriptException
script
- String representing a script codeengineName
- String a script execution engine.dynamic
- tell if the script is dynamic or staticInvalidScriptException
- if the creation fails.public SelectionScript(String script, String engineName, Serializable[] parameters, boolean dynamic) throws InvalidScriptException
script
- String representing a script codeparameters
- script execution arguments.engineName
- String a script execution engine.dynamic
- tell if the script is dynamic or staticInvalidScriptException
- if the creation fails.public SelectionScript(File file, Serializable[] parameters) throws InvalidScriptException
file
- a file containing the scriptparameters
- script execution arguments.InvalidScriptException
- if the creation fails.public SelectionScript(File file, Serializable[] parameters, boolean dynamic) throws InvalidScriptException
file
- a file containing script codeparameters
- script execution arguments.dynamic
- tell if script is dynamic or staticInvalidScriptException
- if the creation fails.public SelectionScript(URL url) throws InvalidScriptException
url
- an URL representing a script codeInvalidScriptException
- if the creation failspublic SelectionScript(URL url, boolean dynamic) throws InvalidScriptException
url
- an URL representing a script codeInvalidScriptException
- if the creation failspublic SelectionScript(URL url, String engineName) throws InvalidScriptException
url
- an URL representing a script codeengineName
- script's engine execution name.InvalidScriptException
- if the creation failspublic SelectionScript(URL url, String engineName, boolean dynamic) throws InvalidScriptException
url
- an URL representing a script codeengineName
- script's engine execution name.dynamic
- true if the script is dynamicInvalidScriptException
- if the creation failspublic SelectionScript(URL url, Serializable[] parameters) throws InvalidScriptException
url
- an URL representing a script codeparameters
- script execution argument.InvalidScriptException
- if the creation failspublic SelectionScript(URL url, Serializable[] parameters, boolean dynamic) throws InvalidScriptException
url
- an URL representing a script codeparameters
- execution argumentsdynamic
- true if the script is dynamicInvalidScriptException
- if the creation fails.public SelectionScript(URL url, String engineName, Serializable[] parameters) throws InvalidScriptException
url
- an URL representing a script codeengineName
- script's engine execution name.parameters
- script execution argument.InvalidScriptException
- if the creation failspublic SelectionScript(URL url, String engineName, Serializable[] parameters, boolean dynamic) throws InvalidScriptException
url
- an URL representing a script codeengineName
- script's engine execution name.parameters
- execution argumentsdynamic
- true if the script is dynamicInvalidScriptException
- if the creation fails.public SelectionScript(Script<?> script, boolean dynamic) throws InvalidScriptException
script
- selection script sourcedynamic
- true if the script is dynamicInvalidScriptException
- if the creation fails.protected String getDefaultScriptName()
getDefaultScriptName
in class Script<Boolean>
public void buildSelectionScriptId()
public String getId()
Script
getId
in class Script<Boolean>
Script.getId()
protected Reader getReader()
Script
protected ScriptResult<Boolean> getResult(Object evalResult, Bindings bindings)
getResult
in class Script<Boolean>
Script.getResult(Object, Bindings)
public boolean isDynamic()
protected void prepareSpecialBindings(Bindings bindings)
prepareSpecialBindings
in class Script<Boolean>
public boolean equals(Object o)
equals
in class Script<Boolean>
Script.equals(java.lang.Object)
public int hashCode()
hashCode
in class Script<Boolean>
Object.hashCode()
public byte[] digest() throws NoSuchAlgorithmException
NoSuchAlgorithmException
public boolean compareByteArray(byte[] array1, byte[] array2)
array1
- first array to comparearray2
- second array to comparepublic static int hashCodeFromList(List<SelectionScript> selScriptsList)
selScriptsList
- a list of selection scripts