mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-18 19:05:06 +00:00
Extend AbstractComponent and remove logger
This commit is contained in:
parent
57a83fce07
commit
05aa1d90b8
@ -19,27 +19,25 @@
|
|||||||
|
|
||||||
package org.elasticsearch.action.support;
|
package org.elasticsearch.action.support;
|
||||||
|
|
||||||
|
import org.elasticsearch.common.component.AbstractComponent;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.logging.ESLogger;
|
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.node.settings.NodeSettingsService;
|
import org.elasticsearch.node.settings.NodeSettingsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for dealing with destructive operations and wildcard usage.
|
* Helper for dealing with destructive operations and wildcard usage.
|
||||||
*/
|
*/
|
||||||
public final class DestructiveOperations implements NodeSettingsService.Listener {
|
public final class DestructiveOperations extends AbstractComponent implements NodeSettingsService.Listener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setting which controls whether wildcard usage (*, prefix*, _all) is allowed.
|
* Setting which controls whether wildcard usage (*, prefix*, _all) is allowed.
|
||||||
*/
|
*/
|
||||||
public static final String REQUIRES_NAME = "action.destructive_requires_name";
|
public static final String REQUIRES_NAME = "action.destructive_requires_name";
|
||||||
|
|
||||||
private final ESLogger logger = Loggers.getLogger(DestructiveOperations.class);
|
|
||||||
private volatile boolean destructiveRequiresName;
|
private volatile boolean destructiveRequiresName;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DestructiveOperations(Settings settings, NodeSettingsService nodeSettingsService) {
|
public DestructiveOperations(Settings settings, NodeSettingsService nodeSettingsService) {
|
||||||
|
super(settings);
|
||||||
destructiveRequiresName = settings.getAsBoolean(DestructiveOperations.REQUIRES_NAME, false);
|
destructiveRequiresName = settings.getAsBoolean(DestructiveOperations.REQUIRES_NAME, false);
|
||||||
nodeSettingsService.addListener(this);
|
nodeSettingsService.addListener(this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user