ClusterState.FeatureAware, Diffable<MetaData.Custom>, MetaData.Custom, NamedDiffable<MetaData.Custom>, NamedWriteable, VersionedNamedWriteable, Writeable, ToXContent, ToXContentFragmentpublic final class ScriptMetaData extends java.lang.Object implements MetaData.Custom, Writeable, ToXContentFragment
ScriptMetaData is used to store user-defined scripts
as part of the ClusterState using only an id as the key.| Modifier and Type | Class | Description |
|---|---|---|
static class |
ScriptMetaData.Builder |
A builder used to modify the currently stored scripts data held within
the
ClusterState. |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
TYPE |
The type of
ClusterState data. |
EMPTY_PARAMS| Constructor | Description |
|---|---|
ScriptMetaData(StreamInput in) |
| Modifier and Type | Method | 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. |
Version |
getMinimalSupportedVersion() |
The minimal version of the recipient this object can be sent to
|
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.
|
getRequiredFeatureclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentpublic static final java.lang.String TYPE
ClusterState data.public ScriptMetaData(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static ScriptMetaData fromXContent(XContentParser parser) throws java.io.IOException
ScriptMetaData.
The following format will be parsed:
{
"<id>" : "<{@link StoredScriptSource#fromXContent(XContentParser)}>",
"<id>" : "<{@link StoredScriptSource#fromXContent(XContentParser)}>",
...
}
When loading from a source prior to 6.0, if multiple scripts
using the old namespace id format of [lang#id] are found to have the
same id but different languages an error will occur.java.io.IOExceptionpublic static NamedDiff<MetaData.Custom> readDiffFrom(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
Writeablepublic 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 ToXContentjava.io.IOExceptionpublic Diff<MetaData.Custom> diff(MetaData.Custom before)
Diffablediff in interface Diffable<MetaData.Custom>public java.lang.String getWriteableName()
VersionedNamedWriteablegetWriteableName in interface NamedWriteablegetWriteableName in interface VersionedNamedWriteablepublic Version getMinimalSupportedVersion()
VersionedNamedWriteablegetMinimalSupportedVersion in interface VersionedNamedWriteablepublic java.util.EnumSet<MetaData.XContentContext> context()
context in interface MetaData.Custompublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object