Adapting to changes in Plugin api
This commit is contained in:
parent
6d4673fd58
commit
be19d13d14
|
@ -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<ActionHandler<? extends ActionRequest<?>, ? 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<Class<? extends RestHandler>> getRestHandlers() {
|
||||
return Arrays.asList(RestRankEvalAction.class);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue