Class PluginDescriptor

java.lang.Object
org.elasticsearch.plugins.PluginDescriptor
All Implemented Interfaces:
Writeable, ToXContent, ToXContentObject

public class PluginDescriptor extends Object implements Writeable, ToXContentObject
An in-memory representation of the plugin descriptor.
  • Field Details

  • Constructor Details

    • PluginDescriptor

      public PluginDescriptor(String name, String description, String version, Version 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 plugin
      description - a description of the plugin
      version - an opaque version identifier for the plugin
      elasticsearchVersion - the version of Elasticsearch the plugin was built for
      javaVersion - the version of Java the plugin was built with
      classname - the entry point to the plugin
      moduleName - the module name to load the plugin class from, or null if not in a module
      extendedPlugins - other plugins this plugin extends through SPI
      hasNativeController - whether or not the plugin has a native controller
      isLicensed - whether is this a licensed plugin
      isModular - whether this plugin should be loaded in a module layer
    • PluginDescriptor

      public PluginDescriptor(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 Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • readFromProperties

      public static PluginDescriptor readFromProperties(Path pluginDir) throws IOException
      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
    • 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
    • getModuleName

      public Optional<String> getModuleName()
      The module name of the plugin.
      Returns:
      the module name of 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:
      true if 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:
      toXContent in interface ToXContent
      Throws:
      IOException
    • toXContentFragment

      public XContentBuilder toXContentFragment(XContentBuilder builder, ToXContent.Params params) throws IOException
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(String prefix)