java.lang.Object
org.elasticsearch.plugins.PluginDescriptor
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
An in-memory representation of the plugin descriptor.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionPluginDescriptor(String name, String description, String version, String elasticsearchVersion, String javaVersion, String classname, String moduleName, List<String> extendedPlugins, boolean hasNativeController, boolean isLicensed, boolean isModular, boolean isStable) Construct plugin info.Construct plugin info from a stream. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe entry point to the plugin.The description of the plugin.The version of Elasticsearch the plugin was built for.Other plugins this plugin extends through SPI.The version of Java the plugin was built with.The module name of the plugin.getName()The name of the plugin.The version of the plugininthashCode()booleanWhether or not the plugin has a native controller.booleanWhether this plugin is subject to the Elastic License.booleanWhether this plugin should be loaded in a module layer.booleanisStable()Whether this plugin uses only stable APIs.static PluginDescriptorreadFromProperties(Path pluginDir) Reads the descriptor file for a plugin.static PluginDescriptorReads the internal descriptor for a classic plugin.toString()toXContent(XContentBuilder builder, ToXContent.Params params) toXContentFragment(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, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
INTERNAL_DESCRIPTOR_FILENAME
- See Also:
-
STABLE_DESCRIPTOR_FILENAME
- See Also:
-
NAMED_COMPONENTS_FILENAME
- See Also:
-
-
Constructor Details
-
PluginDescriptor
public PluginDescriptor(String name, String description, String version, String elasticsearchVersion, String javaVersion, String classname, String moduleName, List<String> extendedPlugins, boolean hasNativeController, boolean isLicensed, boolean isModular, boolean isStable) 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 pluginmoduleName- the module name to load the plugin class from, or null if not in a moduleextendedPlugins- other plugins this plugin extends through SPIhasNativeController- whether or not the plugin has a native controllerisLicensed- whether is this a licensed pluginisModular- whether this plugin should be loaded in a module layerisStable- whether this plugin is implemented using the stable plugin API
-
PluginDescriptor
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 Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
readFromProperties
Reads the descriptor file for a plugin.- Parameters:
pluginDir- 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
-
readInternalDescriptorFromStream
public static PluginDescriptor readInternalDescriptorFromStream(InputStream stream) throws IOException Reads the internal descriptor for a classic plugin.- Parameters:
stream- the InputStream from which to read the plugin data- Returns:
- the plugin info
- Throws:
IOException- if an I/O exception occurred reading the plugin descriptor
-
getName
The name of the plugin.- Returns:
- the plugin name
-
getDescription
The description of the plugin.- Returns:
- the plugin description
-
getClassname
The entry point to the plugin.- Returns:
- the entry point to the plugin
-
getModuleName
The module name of the plugin.- Returns:
- the module name of the plugin
-
getExtendedPlugins
Other plugins this plugin extends through SPI.- Returns:
- the names of the plugins extended
-
getVersion
The version of the plugin- Returns:
- the version
-
getElasticsearchVersion
The version of Elasticsearch the plugin was built for.- Returns:
- an Elasticsearch version
-
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
-
isLicensed
public boolean isLicensed()Whether this plugin is subject to the Elastic License. -
isModular
public boolean isModular()Whether this plugin should be loaded in a module layer. -
isStable
public boolean isStable()Whether this plugin uses only stable APIs. -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toXContentFragment
public XContentBuilder toXContentFragment(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-
toString
-