io.coinapi.websocket.CoinAPIWebSocketImpl Maven / Gradle / Ivy
package io.coinapi.websocket;
import com.dslplatform.json.DslJson;
import io.coinapi.websocket.exception.NotImplementedException;
import io.coinapi.websocket.interfaces.InvokeFunction;
import io.coinapi.websocket.model.*;
import org.glassfish.tyrus.client.ClientManager;
import javax.websocket.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Optional;
import java.util.Queue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;
public class CoinAPIWebSocketImpl implements CoinAPIWebSocket {
private final String sandboxUrl = "wss://ws-sandbox.coinapi.io/v1/";
private final String noSandboxUrl = "wss://ws.coinapi.io/v1/";
private Boolean isSandbox;
private DslJson