use existing constant to check whether client is a transport client
This commit is contained in:
parent
61d5ccbe7d
commit
8425d26b70
|
@ -22,6 +22,7 @@ package org.elasticsearch.plugin.ingest;
|
|||
|
||||
import org.elasticsearch.action.ActionModule;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.elasticsearch.common.component.LifecycleComponent;
|
||||
import org.elasticsearch.common.inject.Module;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
@ -56,7 +57,7 @@ public class IngestPlugin extends Plugin {
|
|||
|
||||
public IngestPlugin(Settings nodeSettings) {
|
||||
this.nodeSettings = nodeSettings;
|
||||
transportClient = "transport".equals(nodeSettings.get(Client.CLIENT_TYPE_SETTING));
|
||||
transportClient = TransportClient.CLIENT_TYPE.equals(nodeSettings.get(Client.CLIENT_TYPE_SETTING));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,7 +96,7 @@ public class IngestPlugin extends Plugin {
|
|||
}
|
||||
|
||||
public void onModule(ActionModule module) {
|
||||
if (!transportClient) {
|
||||
if (transportClient == false) {
|
||||
module.registerFilter(IngestActionFilter.class);
|
||||
}
|
||||
module.registerAction(PutPipelineAction.INSTANCE, PutPipelineTransportAction.class);
|
||||
|
@ -108,5 +109,4 @@ public class IngestPlugin extends Plugin {
|
|||
restModule.addRestAction(RestGetPipelineAction.class);
|
||||
restModule.addRestAction(RestDeletePipelineAction.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue