public class ScriptedAttributeDefinition extends BaseAttributeDefinition
Modifier and Type | Field and Description |
---|---|
private CompiledScript |
compiledScript
The compiled form of the script, if the script engine supports compiling.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
script
The script to execute.
|
private ScriptEngine |
scriptEngine
The script engine to execute the script.
|
private String |
scriptLanguage
The scripting language.
|
Constructor and Description |
---|
ScriptedAttributeDefinition(String language)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
compileScript()
Compiles the script if the scripting engine supports it.
|
protected BaseAttribute<?> |
doResolve(ShibbolethResolutionContext resolutionContext)
Creates and populates the values for the resolved attribute.
|
String |
getScript()
Gets the script that will be executed.
|
protected ScriptContext |
getScriptContext(ShibbolethResolutionContext resolutionContext)
Creates the script execution context from the resolution context.
|
String |
getScriptLanguage()
Gets the scripting language used.
|
void |
initialize()
Initializes this attribute definition.
|
void |
setScript(String newScript)
Sets the script that will be executed.
|
void |
validate()
Validate the internal state of this plug-in.
|
getAttributeEncoders, getDisplayDescriptions, getDisplayNames, getSourceAttributeID, getValuesFromAllDependencies, isDependencyOnly, resolve, setDependencyOnly, setSourceAttributeID
getDependencyIds, getId, getValuesFromAllDependencies, getValuesFromAttributeDependency, getValuesFromConnectorDependency, setId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDependencyIds, getId
private final org.slf4j.Logger log
private String scriptLanguage
private String script
private ScriptEngine scriptEngine
private CompiledScript compiledScript
public ScriptedAttributeDefinition(String language)
language
- the scripting language that will be usedpublic String getScriptLanguage()
public String getScript()
public void setScript(String newScript)
newScript
- script that will be executedpublic void initialize()
public void validate() throws AttributeResolutionException
AttributeResolutionException
- if the plug-in has an invalid internal stateprotected BaseAttribute<?> doResolve(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
doResolve
in class BaseAttributeDefinition
resolutionContext
- current attribute resolution contextAttributeResolutionException
- thrown if there is a problem resolving and creating the attributeprotected void compileScript()
protected ScriptContext getScriptContext(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
resolutionContext
- current resolution contextAttributeResolutionException
- thrown if dependent data connectors or attribute definitions can not be
resolvedCopyright © 1999-2012. All Rights Reserved.