Package org.elasticsearch.script
Class ScriptMetaData.Builder
- java.lang.Object
-
- org.elasticsearch.script.ScriptMetaData.Builder
-
- Enclosing class:
- ScriptMetaData
public static final class ScriptMetaData.Builder extends java.lang.Object
A builder used to modify the currently stored scripts data held within theClusterState
. Scripts can be added or deleted, then built to generate a newMap
of scripts that will be used to update the currentClusterState
.
-
-
Constructor Summary
Constructors Constructor Description Builder(ScriptMetaData previous)
-
Method Summary
Modifier and Type Method Description ScriptMetaData
build()
ScriptMetaData.Builder
deleteScript(java.lang.String id)
Delete a script from the existing stored scripts based on a user-specified id.ScriptMetaData.Builder
storeScript(java.lang.String id, StoredScriptSource source)
Add a new script to the existing stored scripts based on a user-specified id.
-
-
-
Constructor Detail
-
Builder
public Builder(ScriptMetaData previous)
- Parameters:
previous
- The currentScriptMetaData
ornull
if there is no existingScriptMetaData
.
-
-
Method Detail
-
storeScript
public ScriptMetaData.Builder storeScript(java.lang.String id, StoredScriptSource source)
Add a new script to the existing stored scripts based on a user-specified id. If a script with the same id already exists it will be overwritten.- Parameters:
id
- The user-specified id to use for the look up.source
- The user-specified stored script data held inStoredScriptSource
.
-
deleteScript
public ScriptMetaData.Builder deleteScript(java.lang.String id)
Delete a script from the existing stored scripts based on a user-specified id.- Parameters:
id
- The user-specified id to use for the look up.
-
build
public ScriptMetaData build()
- Returns:
- A
ScriptMetaData
with the updatedMap
of scripts.
-
-