Interface ScriptingManager
public interface ScriptingManager
ScriptingManager. Defines the operations that can be performed on scripts. Scripts are stored in
a dedicated cache.
- Since:
- 7.2
- Author:
- Tristan Tarrant
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new named script.voidAdds a new named script with user-specified metadatabooleancontainsScript(String scriptName) Returns whether a script existsRetrieves the source code of an existing script.Retrieves names of all available scripts.org.infinispan.scripting.impl.ScriptWithMetadatagetScriptWithMetadata(String scriptName) Retrieves the source code of an existing script together with its metadatavoidremoveScript(String name) Removes a script.<T> CompletionStage<T> Runs a named script<T> CompletionStage<T> runScript(String scriptName, TaskContext context) Runs a named script using the specifiedTaskContext
-
Field Details
-
SCRIPT_CACHE
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
SCRIPT_MANAGER_ROLE
Deprecated, for removal: This API element is subject to removal in a future version.since 12.1. Will be removed in 15.0. Use the CREATE permission instead.- See Also:
-
-
Method Details
-
addScript
-
addScript
Adds a new named script with user-specified metadata- Parameters:
name- the name of the script. The name should contain an extension identifying its languagescript- the source of the scriptmetadata- the metadata for the script
-
removeScript
Removes a script.- Parameters:
name- the name of the script ro remove
-
runScript
Runs a named script- Parameters:
scriptName- The name of the script to run. UseaddScript(String, String)to add a script- Returns:
- a
CompletableFuturewhich will return the result of the script execution
-
runScript
Runs a named script using the specifiedTaskContext- Parameters:
scriptName- The name of the script to run. UseaddScript(String, String)to add a scriptcontext- ATaskContextwithin which the script will be executed- Returns:
- a
CompletableFuturewhich will return the result of the script execution
-
getScript
-
getScriptWithMetadata
Retrieves the source code of an existing script together with its metadata- Parameters:
scriptName- The name of the script- Returns:
- the source code of the script
-
getScriptNames
-
containsScript
Returns whether a script exists- Parameters:
scriptName- the name of the script- Returns:
- a boolean indicating script existence
-