Package org.cyclos.impl.system
Interface CustomScriptServiceLocal
-
- All Superinterfaces:
CRUDService<CustomScriptDTO,CustomScriptData,ScriptType>,CRUDServiceLocal<CustomScript,CustomScriptDTO,CustomScriptData,ScriptType>,CustomScriptService,Service
- All Known Implementing Classes:
CustomScriptServiceImpl
public interface CustomScriptServiceLocal extends CRUDServiceLocal<CustomScript,CustomScriptDTO,CustomScriptData,ScriptType>, CustomScriptService
Local interface forCustomScriptServiceLocal
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_ENTITY_MANAGERScript context binding: the JPA EntityManager instancestatic StringATTR_FORMATTERScript context binding: theFormatterImplinstancestatic StringATTR_SCRIPT_HELPERScript context binding: theScriptHelperinstancestatic StringATTR_SCRIPT_PARAMETERSScript context binding: script parameters, asPropertiesstatic StringATTR_SESSION_DATAScript context binding: theSessionDatainstancestatic StringATTR_TRANSACTION_LEVELScript context binding: theTransactionLevelinstancestatic StringATTR_TRANSACTION_STATUSScript context binding: theTransactionStatusinstance
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ScriptFunction[]getFunctions(ScriptType type)Returns the script function instances for the given typeSet<Long>getReverseDependencyIds(Long id)Returns the identifiers of all scripts which depend, directly or indirectly on the script with the given id.List<CustomScript>listByType(ScriptType type)Returns a list of scripts by typeCustomScriptAccessornewAccessor(CustomScript script, String scriptParameters)Returns aCustomScriptAccessorwhich can be used to run the given script.Pair<String,String>resolveCodeAndParameters(CustomScript script, ScriptFunction function)Returns the final code for the given script function, together with the final parameters, concatenated from all dependencies.voidrunInlineScriptAsBackgroundTask(String code)Creates aInlineScriptBackgroundTaskwith the given code, and schedules its execution.<T> TrunScript(String code)Runs the given script code directly.-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, newEntity, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
Methods inherited from interface org.cyclos.services.system.CustomScriptService
getCodeForDebug, getRunData, run, search
-
-
-
-
Field Detail
-
ATTR_SCRIPT_PARAMETERS
static final String ATTR_SCRIPT_PARAMETERS
Script context binding: script parameters, asProperties- See Also:
- Constant Field Values
-
ATTR_SCRIPT_HELPER
static final String ATTR_SCRIPT_HELPER
Script context binding: theScriptHelperinstance- See Also:
- Constant Field Values
-
ATTR_SESSION_DATA
static final String ATTR_SESSION_DATA
Script context binding: theSessionDatainstance- See Also:
- Constant Field Values
-
ATTR_TRANSACTION_STATUS
static final String ATTR_TRANSACTION_STATUS
Script context binding: theTransactionStatusinstance- See Also:
- Constant Field Values
-
ATTR_TRANSACTION_LEVEL
static final String ATTR_TRANSACTION_LEVEL
Script context binding: theTransactionLevelinstance- See Also:
- Constant Field Values
-
ATTR_ENTITY_MANAGER
static final String ATTR_ENTITY_MANAGER
Script context binding: the JPA EntityManager instance- See Also:
- Constant Field Values
-
ATTR_FORMATTER
static final String ATTR_FORMATTER
Script context binding: theFormatterImplinstance- See Also:
- Constant Field Values
-
-
Method Detail
-
getFunctions
ScriptFunction[] getFunctions(ScriptType type)
Returns the script function instances for the given type
-
getReverseDependencyIds
Set<Long> getReverseDependencyIds(Long id)
Returns the identifiers of all scripts which depend, directly or indirectly on the script with the given id. The purpose of exposing this method in the interface is to test it
-
listByType
List<CustomScript> listByType(ScriptType type)
Returns a list of scripts by type
-
newAccessor
CustomScriptAccessor newAccessor(CustomScript script, String scriptParameters)
Returns aCustomScriptAccessorwhich can be used to run the given script.
-
resolveCodeAndParameters
Pair<String,String> resolveCodeAndParameters(CustomScript script, ScriptFunction function)
Returns the final code for the given script function, together with the final parameters, concatenated from all dependencies. The purpose of exposing this method in the interface is to test it
-
runInlineScriptAsBackgroundTask
void runInlineScriptAsBackgroundTask(String code)
Creates aInlineScriptBackgroundTaskwith the given code, and schedules its execution. If the code returns a number, it is interpreted as the number of affected records (for logging).
-
runScript
<T> T runScript(String code)
Runs the given script code directly. Will run as system, with all default bindings available
-
-