Package org.elasticsearch.plugins
Class PluginInfo
- java.lang.Object
-
- org.elasticsearch.plugins.PluginInfo
-
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public class PluginInfo extends Object implements Writeable, ToXContentObject
An in-memory representation of the plugin descriptor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static StringES_PLUGIN_POLICYstatic StringES_PLUGIN_PROPERTIES-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description PluginInfo(String name, String description, String version, Version elasticsearchVersion, String javaVersion, String classname, List<String> extendedPlugins, boolean hasNativeController)Construct plugin info.PluginInfo(StreamInput in)Construct plugin info from a stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetClassname()The entry point to the plugin.StringgetDescription()The description of the plugin.VersiongetElasticsearchVersion()The version of Elasticsearch the plugin was built for.List<String>getExtendedPlugins()Other plugins this plugin extends through SPI.StringgetJavaVersion()The version of Java the plugin was built with.StringgetName()The name of the plugin.StringgetVersion()The version of the plugininthashCode()booleanhasNativeController()Whether or not the plugin has a native controller.static PluginInforeadFromProperties(Path path)Reads the plugin descriptor file.StringtoString()StringtoString(String prefix)XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
ES_PLUGIN_PROPERTIES
public static final String ES_PLUGIN_PROPERTIES
- See Also:
- Constant Field Values
-
ES_PLUGIN_POLICY
public static final String ES_PLUGIN_POLICY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PluginInfo
public PluginInfo(String name, String description, String version, Version elasticsearchVersion, String javaVersion, String classname, List<String> extendedPlugins, boolean hasNativeController)
Construct plugin info.- Parameters:
name- the name of the plugindescription- a description of the pluginversion- an opaque version identifier for the pluginelasticsearchVersion- the version of Elasticsearch the plugin was built forjavaVersion- the version of Java the plugin was built withclassname- the entry point to the pluginextendedPlugins- other plugins this plugin extends through SPIhasNativeController- whether or not the plugin has a native controller
-
PluginInfo
public PluginInfo(StreamInput in) throws IOException
Construct plugin info from a stream.- Parameters:
in- the stream- Throws:
IOException- if an I/O exception occurred reading the plugin info from the stream
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
readFromProperties
public static PluginInfo readFromProperties(Path path) throws IOException
Reads the plugin descriptor file.- Parameters:
path- the path to the root directory for the plugin- Returns:
- the plugin info
- Throws:
IOException- if an I/O exception occurred reading the plugin descriptor
-
getName
public String getName()
The name of the plugin.- Returns:
- the plugin name
-
getDescription
public String getDescription()
The description of the plugin.- Returns:
- the plugin description
-
getClassname
public String getClassname()
The entry point to the plugin.- Returns:
- the entry point to the plugin
-
getExtendedPlugins
public List<String> getExtendedPlugins()
Other plugins this plugin extends through SPI.- Returns:
- the names of the plugins extended
-
getVersion
public String getVersion()
The version of the plugin- Returns:
- the version
-
getElasticsearchVersion
public Version getElasticsearchVersion()
The version of Elasticsearch the plugin was built for.- Returns:
- an Elasticsearch version
-
getJavaVersion
public String getJavaVersion()
The version of Java the plugin was built with.- Returns:
- a java version string
-
hasNativeController
public boolean hasNativeController()
Whether or not the plugin has a native controller.- Returns:
trueif the plugin has a native controller
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
-