All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.upstox.feeder.Feeder Maven / Gradle / Ivy

There is a newer version: 1.7.0
Show newest version
package com.upstox.feeder;

import org.java_websocket.client.WebSocketClient;

import com.upstox.ApiClient;
import com.upstox.feeder.listener.OnCloseListener;
import com.upstox.feeder.listener.OnErrorListener;
import com.upstox.feeder.listener.OnMessageListener;
import com.upstox.feeder.listener.OnOpenListener;

public abstract class Feeder {

    protected ApiClient apiClient;

    protected WebSocketClient webSocket;

    protected OnOpenListener onOpenListener;
    protected OnMessageListener onMessageListener;
    protected OnErrorListener onErrorListener;
    protected OnCloseListener onCloseListener;

    protected Feeder(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    protected ApiClient getApiClient() {
        return apiClient;
    }

    protected void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    protected abstract void connect();

    protected void disconnect() {
        this.webSocket.close(1000);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy