public final class ScriptMetaData extends java.lang.Object implements MetaData.Custom, Writeable, ToXContent
ScriptMetaData
is used to store user-defined scripts
as part of the ClusterState
. Currently scripts can
be stored as part of the new namespace for a stored script where
only an id is used or as part of the deprecated namespace where
both a language and an id are used.Modifier and Type | Class and Description |
---|---|
static class |
ScriptMetaData.Builder
A builder used to modify the currently stored scripts data held within
the
ClusterState . |
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE
The type of
ClusterState data. |
EMPTY_PARAMS
Constructor and Description |
---|
ScriptMetaData(StreamInput in) |
Modifier and Type | Method and Description |
---|---|
java.util.EnumSet<MetaData.XContentContext> |
context() |
Diff<MetaData.Custom> |
diff(MetaData.Custom before)
Returns serializable object representing differences between this and previousState
|
boolean |
equals(java.lang.Object o) |
static ScriptMetaData |
fromXContent(XContentParser parser)
This will parse XContent into
ScriptMetaData . |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
int |
hashCode() |
static NamedDiff<MetaData.Custom> |
readDiffFrom(StreamInput in) |
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params)
This will write XContent from
ScriptMetaData . |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getMinimalSupportedVersion
isFragment
public static final java.lang.String TYPE
ClusterState
data.public ScriptMetaData(StreamInput in) throws java.io.IOException
java.io.IOException
public static ScriptMetaData fromXContent(XContentParser parser) throws java.io.IOException
ScriptMetaData
.
The following format will be parsed for the new namespace:
{
"<id>" : "<{@link StoredScriptSource#fromXContent(XContentParser)}>",
"<id>" : "<{@link StoredScriptSource#fromXContent(XContentParser)}>",
...
}
The following format will be parsed for the deprecated namespace:
{
"<id>" : "<code>",
"<id>" : "<code>",
...
}
Note when using the deprecated namespace, the language will be pulled from
the id and options will be set to an empty Map
.java.io.IOException
public static NamedDiff<MetaData.Custom> readDiffFrom(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
ScriptMetaData
. The following format will be written:
{
"<id>" : "<{@link StoredScriptSource#toXContent(XContentBuilder, Params)}>",
"<id>" : "<{@link StoredScriptSource#toXContent(XContentBuilder, Params)}>",
...
}
toXContent
in interface ToXContent
java.io.IOException
public Diff<MetaData.Custom> diff(MetaData.Custom before)
Diffable
diff
in interface Diffable<MetaData.Custom>
public java.lang.String getWriteableName()
NamedWriteable
getWriteableName
in interface NamedWriteable
public java.util.EnumSet<MetaData.XContentContext> context()
context
in interface MetaData.Custom
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object