001package org.xbib.elasticsearch.action.websocket.bulk;
002
003import org.elasticsearch.client.Client;
004import org.elasticsearch.common.inject.Inject;
005import org.elasticsearch.common.settings.Settings;
006import org.xbib.elasticsearch.websocket.InteractiveChannel;
007import org.xbib.elasticsearch.websocket.InteractiveController;
008import org.xbib.elasticsearch.websocket.InteractiveRequest;
009
010/**
011 * Bulk flush action. This action forces bulk requests to get
012 * sent to the cluster.
013 */
014public class BulkFlushAction extends BulkHandler {
015
016    private final static String TYPE = "flush";
017
018    @Inject
019    public BulkFlushAction(Settings settings, Client client, InteractiveController controller) {
020        super(settings, client);
021        controller.registerHandler(TYPE, this);
022    }
023
024    @Override
025    public void handleRequest(final InteractiveRequest request, final InteractiveChannel channel) {
026        this.flush(channel);
027    }
028}