Skip to content
Permalink
Browse files
Updated REST handlers to conform to changes in abstract class org.ela…
…sticsearch.rest.BaseRestHandler as of Elasticsearch 7.4.0. No plan to support compatibility with versions prior to Elasticsearch 7.4.0.
  • Loading branch information
davemoore- committed Mar 5, 2020
1 parent 7374a63 commit 84d101b48cce70dfad34e31e234a52982c0d6ec2
Showing 8 changed files with 18 additions and 40 deletions.
@@ -3,29 +3,14 @@ jdk:
- oraclejdk11
env:
matrix:
- ELASTICSEARCH_VERSION=7.3.2
- ELASTICSEARCH_VERSION=7.3.1
- ELASTICSEARCH_VERSION=7.3.0
- ELASTICSEARCH_VERSION=7.2.1
- ELASTICSEARCH_VERSION=7.2.0
- ELASTICSEARCH_VERSION=7.1.1
- ELASTICSEARCH_VERSION=7.1.0
- ELASTICSEARCH_VERSION=7.0.1
- ELASTICSEARCH_VERSION=7.0.0
- ELASTICSEARCH_VERSION=6.8.2
- ELASTICSEARCH_VERSION=6.8.1
- ELASTICSEARCH_VERSION=6.8.0
- ELASTICSEARCH_VERSION=6.7.2
- ELASTICSEARCH_VERSION=6.7.1
- ELASTICSEARCH_VERSION=6.7.0
- ELASTICSEARCH_VERSION=6.6.2
- ELASTICSEARCH_VERSION=6.6.1
- ELASTICSEARCH_VERSION=6.6.0
- ELASTICSEARCH_VERSION=6.5.4
- ELASTICSEARCH_VERSION=6.5.3
- ELASTICSEARCH_VERSION=6.5.2
- ELASTICSEARCH_VERSION=6.5.1
- ELASTICSEARCH_VERSION=6.5.0
- ELASTICSEARCH_VERSION=7.6.1
- ELASTICSEARCH_VERSION=7.6.0
- ELASTICSEARCH_VERSION=7.5.2
- ELASTICSEARCH_VERSION=7.5.1
- ELASTICSEARCH_VERSION=7.5.0
- ELASTICSEARCH_VERSION=7.4.2
- ELASTICSEARCH_VERSION=7.4.1
- ELASTICSEARCH_VERSION=7.4.0

script: "mvn clean install -Delasticsearch.version=${ELASTICSEARCH_VERSION}"

@@ -16,7 +16,7 @@
<zentity.website>https://zentity.io</zentity.website>
<zentity.version>1.5.1</zentity.version>
<!-- dependency versions -->
<elasticsearch.version>7.3.2</elasticsearch.version>
<elasticsearch.version>7.6.0</elasticsearch.version>
<jackson.core.version>2.9.9</jackson.core.version>
<jackson.databind.version>2.9.9.2</jackson.databind.version>
<jdk.version>1.11</jdk.version>
@@ -2,7 +2,6 @@

import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.rest.BaseRestHandler;
@@ -18,8 +17,7 @@
public class HomeAction extends BaseRestHandler {

@Inject
public HomeAction(Settings settings, RestController controller) {
super(settings);
public HomeAction(RestController controller) {
controller.registerHandler(GET, "_zentity", this);
}

@@ -15,7 +15,6 @@
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
@@ -38,8 +37,7 @@ public class ModelsAction extends BaseRestHandler {
public static final String INDEX_NAME = ".zentity-models";

@Inject
public ModelsAction(Settings settings, RestController controller) {
super(settings);
public ModelsAction(RestController controller) {
controller.registerHandler(GET, "_zentity/models", this);
controller.registerHandler(GET, "_zentity/models/{entity_type}", this);
controller.registerHandler(POST, "_zentity/models/{entity_type}", this);
@@ -7,7 +7,6 @@
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestController;
@@ -19,8 +18,7 @@
public class ResolutionAction extends BaseRestHandler {

@Inject
ResolutionAction(Settings settings, RestController controller) {
super(settings);
ResolutionAction(RestController controller) {
controller.registerHandler(POST, "_zentity/resolution", this);
controller.registerHandler(POST, "_zentity/resolution/{entity_type}", this);
}
@@ -48,8 +48,7 @@ public class SetupAction extends BaseRestHandler {
"}";

@Inject
public SetupAction(Settings settings, RestController controller) {
super(settings);
public SetupAction(RestController controller) {
controller.registerHandler(POST, "_zentity/_setup", this);
}

@@ -70,10 +70,10 @@ public List<RestHandler> getRestHandlers(
IndexNameExpressionResolver indexNameExpressionResolver,
Supplier<DiscoveryNodes> nodesInCluster) {
List<RestHandler> handlers = new ArrayList<RestHandler>() {{
new HomeAction(settings, restController);
new ModelsAction(settings, restController);
new ResolutionAction(settings, restController);
new SetupAction(settings, restController);
new HomeAction(restController);
new ModelsAction(restController);
new ResolutionAction(restController);
new SetupAction(restController);
}};
return handlers;
}
@@ -121,7 +121,7 @@
<run-script script="@{home}/bin/elasticsearch"
spawn="@{spawn}">
<nested>
<arg value="-Epidfile=@{es.pidfile}"/>
<arg value="-p=@{es.pidfile}"/>
<arg value="-Ecluster.name=@{es.cluster.name}"/>
<arg value="-Ehttp.port=@{es.http.port}"/>
<arg value="-Etransport.tcp.port=@{es.transport.tcp.port}"/>

0 comments on commit 84d101b

Please sign in to comment.