Skip to content

Commit

Permalink
Updated REST handlers to conform to changes in abstract class org.ela…
Browse files Browse the repository at this point in the history
…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 84d101b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 40 deletions.
31 changes: 8 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ant/integration-tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"/>
Expand Down

0 comments on commit 84d101b

Please sign in to comment.