Class BitmexStreamingExchange

java.lang.Object
org.knowm.xchange.BaseExchange
org.knowm.xchange.bitmex.BitmexExchange
info.bitrich.xchangestream.bitmex.BitmexStreamingExchange
All Implemented Interfaces:
StreamingExchange, Exchange

public class BitmexStreamingExchange
extends BitmexExchange
implements StreamingExchange
Created by Lukas Zaoralek on 12.11.17.
  • Constructor Details

    • BitmexStreamingExchange

      public BitmexStreamingExchange()
  • Method Details

    • initServices

      protected void initServices()
      Overrides:
      initServices in class BitmexExchange
    • connect

      public io.reactivex.Completable connect​(ProductSubscription... args)
      Description copied from interface: StreamingExchange
      Connects to the WebSocket API of the exchange.
      Specified by:
      connect in interface StreamingExchange
      Parameters:
      args - Product subscription is used only in certain exchanges where you need to specify subscriptions during the connect phase.
      Returns:
      Completable that completes upon successful connection.
    • disconnect

      public io.reactivex.Completable disconnect()
      Description copied from interface: StreamingExchange
      Disconnect from the WebSocket API.
      Specified by:
      disconnect in interface StreamingExchange
      Returns:
      Completable that completes upon successful disconnect.
    • getDefaultExchangeSpecification

      public ExchangeSpecification getDefaultExchangeSpecification()
      Specified by:
      getDefaultExchangeSpecification in interface Exchange
      Overrides:
      getDefaultExchangeSpecification in class BitmexExchange
      Returns:
      A default ExchangeSpecification to use during the creation process if one is not supplied
    • getStreamingMarketDataService

      public StreamingMarketDataService getStreamingMarketDataService()
      Description copied from interface: StreamingExchange
      Returns service that can be used to access streaming market data.
      Specified by:
      getStreamingMarketDataService in interface StreamingExchange
    • reconnectFailure

      public io.reactivex.Observable<Throwable> reconnectFailure()
      Description copied from interface: StreamingExchange
      Observable for reconnection failure event. When this happens, it usually indicates that the server or the network is down.
      Specified by:
      reconnectFailure in interface StreamingExchange
      Returns:
      Observable with the exception during reconnection.
    • connectionSuccess

      public io.reactivex.Observable<Object> connectionSuccess()
      Description copied from interface: StreamingExchange
      Observable for connection success event. When this happens, it usually indicates that the server or the network is down.
      Specified by:
      connectionSuccess in interface StreamingExchange
      Returns:
      Observable with the exception during reconnection.
    • connectionStateObservable

      public io.reactivex.Observable<ConnectionStateModel.State> connectionStateObservable()
      Description copied from interface: StreamingExchange
      Observable for connectionState. designed to replaces connectionSuccess reconnectFailure disconnectObservable
      Specified by:
      connectionStateObservable in interface StreamingExchange
      Returns:
      Observable
    • isAlive

      public boolean isAlive()
      Description copied from interface: StreamingExchange
      Checks whether connection to the exchange is alive.
      Specified by:
      isAlive in interface StreamingExchange
      Returns:
      true if connection is open, otherwise false.
    • useCompressedMessages

      public void useCompressedMessages​(boolean compressedMessages)
      Description copied from interface: StreamingExchange
      Set whether or not to enable compression handler.
      Specified by:
      useCompressedMessages in interface StreamingExchange
      Parameters:
      compressedMessages - Defaults to false
    • messageDelay

      public io.reactivex.Observable<Long> messageDelay()
      Description copied from interface: StreamingExchange
      Observable for message delay measure. Every time when the client received a message with a timestamp, the delay time is calculated and pushed to subscribers.
      Specified by:
      messageDelay in interface StreamingExchange
      Returns:
      Observable with the message delay measure.
    • resubscribeChannels

      public void resubscribeChannels()
      Specified by:
      resubscribeChannels in interface StreamingExchange
    • getStreamingService

      public BitmexStreamingService getStreamingService()