java.io.Serializable
, java.lang.Comparable<ScriptType>
, Writeable
public enum ScriptType extends java.lang.Enum<ScriptType> implements Writeable
ScriptService
.
It's also used to by ScriptService
to determine whether or not a Script
is
allowed to be executed based on both default and user-defined settings.Writeable.Reader<V>, Writeable.Writer<V>
Enum Constant | Description |
---|---|
INLINE |
INLINE scripts are specified in numerous queries and compiled on-the-fly.
|
STORED |
STORED scripts are saved as part of the
ClusterState
based on user requests. |
Modifier and Type | Method | Description |
---|---|---|
int |
getId() |
|
java.lang.String |
getName() |
|
ParseField |
getParseField() |
|
boolean |
isDefaultEnabled() |
|
static ScriptType |
readFrom(StreamInput in) |
Reads an int from the input stream and converts it to a
ScriptType . |
java.lang.String |
toString() |
|
static ScriptType |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static ScriptType[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeTo(StreamOutput out) |
Write this into the StreamOutput.
|
public static final ScriptType INLINE
ScriptEngine
if the language is naturally secure (Painless, Mustache, and Expressions).public static final ScriptType STORED
ClusterState
based on user requests. They will be cached when they are first used in a query.
They are turned off by default because most languages are insecure
(Groovy and others), but can be overridden by the specific ScriptEngine
if the language is naturally secure (Painless, Mustache, and Expressions).public static ScriptType[] values()
for (ScriptType c : ScriptType.values()) System.out.println(c);
public static ScriptType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static ScriptType readFrom(StreamInput in) throws java.io.IOException
ScriptType
.IllegalStateException
if no ScriptType is found based on the id.java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public int getId()
ScriptType
.public java.lang.String getName()
ScriptType
based on the ParseField
.public ParseField getParseField()
public boolean isDefaultEnabled()
ScriptType
can be run by default. Note
this can be potentially overridden by any ScriptEngine
.public java.lang.String toString()
toString
in class java.lang.Enum<ScriptType>
getName()
.