public abstract class Plugin
extends java.lang.Object
implements java.io.Closeable
ActionPlugin
AnalysisPlugin
ClusterPlugin
DiscoveryPlugin
IngestPlugin
MapperPlugin
NetworkPlugin
RepositoryPlugin
ScriptPlugin
SearchPlugin
In addition to extension points this class also declares some @Deprecated public final void onModule methods. These
methods should cause any extensions of Plugin that used the pre-5.x style extension syntax to fail to build and point the
plugin author at the new extension syntax. We hope that these make the process of upgrading a plugin from 2.x to 5.x only mildly painful.
| Constructor and Description |
|---|
Plugin() |
| Modifier and Type | Method and Description |
|---|---|
Settings |
additionalSettings()
Additional node settings loaded by the plugin.
|
void |
close()
Close the resources opened by this plugin.
|
java.util.Collection<java.lang.Object> |
createComponents(Client client,
ClusterService clusterService,
ThreadPool threadPool,
ResourceWatcherService resourceWatcherService,
ScriptService scriptService,
SearchRequestParsers searchRequestParsers,
NamedXContentRegistry xContentRegistry)
Returns components added by this plugin.
|
java.util.Collection<Module> |
createGuiceModules()
Node level guice modules.
|
java.util.List<BootstrapCheck> |
getBootstrapChecks()
Returns a list of checks that are enforced when a node starts up once a node has the transport protocol bound to a non-loopback
interface.
|
java.util.function.UnaryOperator<java.util.Map<java.lang.String,MetaData.Custom>> |
getCustomMetaDataUpgrader()
Provides a function to modify global custom meta data on startup.
|
java.util.List<ExecutorBuilder<?>> |
getExecutorBuilders(Settings settings)
Provides the list of this plugin's custom thread pools, empty if
none.
|
java.util.Collection<java.lang.Class<? extends LifecycleComponent>> |
getGuiceServiceClasses()
Node level services that will be automatically started/stopped/closed.
|
java.util.List<NamedWriteableRegistry.Entry> |
getNamedWriteables()
Returns parsers for
NamedWriteable this plugin will use over the transport protocol. |
java.util.List<NamedXContentRegistry.Entry> |
getNamedXContent()
Returns parsers for named objects this plugin will parse from
XContentParser.namedObject(Class, String, Object). |
java.util.List<Setting<?>> |
getSettings()
Returns a list of additional
Setting definitions for this plugin. |
java.util.List<java.lang.String> |
getSettingsFilter()
Returns a list of additional settings filter for this plugin
|
void |
onIndexModule(IndexModule indexModule)
Called before a new index is created on a node.
|
void |
onModule(ActionModule module)
Deprecated.
implement
ActionPlugin instead |
void |
onModule(AnalysisModule module)
Deprecated.
implement
AnalysisPlugin instead |
void |
onModule(ClusterModule module)
Deprecated.
implement
ClusterPlugin instead |
void |
onModule(DiscoveryModule module)
Deprecated.
implement
DiscoveryPlugin instead |
void |
onModule(IndexModule indexModule)
Deprecated.
use #onIndexModule instead
|
void |
onModule(NetworkModule module)
Deprecated.
implement
NetworkPlugin instead |
void |
onModule(RepositoriesModule module)
Deprecated.
implement
RepositoryPlugin instead |
void |
onModule(ScriptModule module)
Deprecated.
implement
ScriptPlugin instead |
void |
onModule(SearchModule module)
Deprecated.
implement
SearchPlugin instead |
void |
onModule(SettingsModule settingsModule)
Deprecated.
use #getSettings and #getSettingsFilter instead
|
public java.util.Collection<Module> createGuiceModules()
public java.util.Collection<java.lang.Class<? extends LifecycleComponent>> getGuiceServiceClasses()
public java.util.Collection<java.lang.Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool, ResourceWatcherService resourceWatcherService, ScriptService scriptService, SearchRequestParsers searchRequestParsers, NamedXContentRegistry xContentRegistry)
LifecycleComponent will have their lifecycle managed.
Note: To aid in the migration away from guice, all objects returned as components will be bound in guice
to themselves.client - A client to make requests to the systemclusterService - A service to allow watching and updating cluster statethreadPool - A service to allow retrieving an executor to run an async actionresourceWatcherService - A service to watch for changes to node local filesscriptService - A service to allow running scripts on the local nodesearchRequestParsers - Parsers for search requests which may be used to templatize search requestspublic Settings additionalSettings()
public java.util.List<NamedWriteableRegistry.Entry> getNamedWriteables()
NamedWriteable this plugin will use over the transport protocol.NamedWriteableRegistrypublic java.util.List<NamedXContentRegistry.Entry> getNamedXContent()
XContentParser.namedObject(Class, String, Object).NamedWriteableRegistrypublic void onIndexModule(IndexModule indexModule)
public java.util.List<Setting<?>> getSettings()
Setting definitions for this plugin.public java.util.List<java.lang.String> getSettingsFilter()
public java.util.function.UnaryOperator<java.util.Map<java.lang.String,MetaData.Custom>> getCustomMetaDataUpgrader()
Plugins should return the input custom map via UnaryOperator.identity() if no upgrade is required.
null. The same or upgraded MetaData.Custom map.java.lang.IllegalStateException - if the node should not start because at least one MetaData.Custom
is unsupportedpublic java.util.List<ExecutorBuilder<?>> getExecutorBuilders(Settings settings)
settings - the current settingspublic java.util.List<BootstrapCheck> getBootstrapChecks()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException - if the plugin failed to close its resources@Deprecated public final void onModule(IndexModule indexModule)
@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(SettingsModule settingsModule)
@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(ScriptModule module)
ScriptPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(AnalysisModule module)
AnalysisPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(ActionModule module)
ActionPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(SearchModule module)
SearchPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(NetworkModule module)
NetworkPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(RepositoriesModule module)
RepositoryPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(ClusterModule module)
ClusterPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.@Deprecated public final void onModule(DiscoveryModule module)
DiscoveryPlugin instead@Deprecated and final to act as a signpost for plugin authors upgrading
from 2.x.