ClusterState.FeatureAware
, Diffable<MetaData.Custom>
, MetaData.Custom
, NamedDiffable<MetaData.Custom>
, NamedWriteable
, VersionedNamedWriteable
, Writeable
, ToXContent
, ToXContentFragment
public 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.Params
Writeable.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.
|
getRequiredFeature
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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:
{
"<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.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()
VersionedNamedWriteable
getWriteableName
in interface NamedWriteable
getWriteableName
in interface VersionedNamedWriteable
public Version getMinimalSupportedVersion()
VersionedNamedWriteable
getMinimalSupportedVersion
in interface VersionedNamedWriteable
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