001package org.xbib.elasticsearch.action.websocket.pubsub;
002
003import org.elasticsearch.client.Client;
004import org.elasticsearch.common.settings.Settings;
005import org.elasticsearch.common.unit.TimeValue;
006import org.xbib.elasticsearch.websocket.BaseInteractiveHandler;
007import org.xbib.elasticsearch.websocket.InteractiveController;
008import org.xbib.elasticsearch.http.HttpServerTransport;
009
010/**
011 * Base class for Publish/Subscribe actions
012 */
013public abstract class PublishSubscribe extends BaseInteractiveHandler {
014
015    protected final String pubSubIndexName;
016
017    protected final HttpServerTransport transport;
018
019    protected final Checkpointer service;
020
021    protected final TimeValue scrollTimeout = new TimeValue(60000);
022
023    protected final int scrollSize = 100;
024
025    public PublishSubscribe(Settings settings,
026                            Client client,
027                            HttpServerTransport transport,
028                            InteractiveController controller,
029                            Checkpointer service) {
030        super(settings, client);
031        this.pubSubIndexName = PubSubIndexName.Conf.indexName(settings);
032        this.transport = transport;
033        this.service = service;
034    }
035
036}