From be19d13d14fae373d1625e065466d334660dd080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 30 Jun 2016 15:05:51 +0200 Subject: [PATCH] Adapting to changes in Plugin api --- .../index/rankeval/RankEvalPlugin.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java index f0bd5c1f838..7aed80fc481 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java @@ -19,28 +19,24 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.action.ActionModule; -import org.elasticsearch.common.network.NetworkModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.rest.RestHandler; -public class RankEvalPlugin extends Plugin { - public static final String NAME = "rank-eval"; +import java.util.Arrays; +import java.util.List; + +public class RankEvalPlugin extends Plugin implements ActionPlugin { @Override - public String name() { - return NAME; + public List, ? extends ActionResponse>> getActions() { + return Arrays.asList(new ActionHandler<>(RankEvalAction.INSTANCE, TransportRankEvalAction.class)); } @Override - public String description() { - return "The rank-eval module adds APIs to evaluate rankings."; - } - - public void onModule(ActionModule actionModule) { - actionModule.registerAction(RankEvalAction.INSTANCE, TransportRankEvalAction.class); - } - - public void onModule(NetworkModule networkModule) { - networkModule.registerRestHandler(RestRankEvalAction.class); + public List> getRestHandlers() { + return Arrays.asList(RestRankEvalAction.class); } }