Package com.xeiam.xchange.service.streaming

Examples of com.xeiam.xchange.service.streaming.DefaultExchangeEvent


      }

      @Override
      public void onError(SocketIOException socketIOException) {

        putEvent(new DefaultExchangeEvent(ExchangeEventType.ERROR, socketIOException.getMessage(), socketIOException));
      }

    });

    super.addListener(new CoinsetterExchangeAdapter() {

      @Override
      public void onTicker(CoinsetterTicker coinsetterTicker) {

        Ticker ticker = CoinsetterAdapters.adaptTicker(coinsetterTicker);
        putEvent(new DefaultExchangeEvent(ExchangeEventType.TICKER, null, ticker));
      }

      @Override
      public void onDepth(CoinsetterPair[] depth) {

        OrderBook orderBook = CoinsetterAdapters.adaptOrderBook(depth);
        putEvent(new DefaultExchangeEvent(ExchangeEventType.DEPTH, null, orderBook));
      }
    });
  }
View Full Code Here


    }
  }

  private void putEvent(ExchangeEventType exchangeEventType) {

    putEvent(new DefaultExchangeEvent(exchangeEventType, null));
  }
View Full Code Here

      public void onEvent(String channelName, String eventName, String data) {

        ExchangeEvent xevt = null;
        try {
          OrderBook snapshot = parseOrderBook(data);
          xevt = new DefaultExchangeEvent(ExchangeEventType.SUBSCRIBE_ORDERS, data, snapshot);
        } catch (IOException e) {
          log.error("JSON stream error", e);
        }
        if (xevt != null) {
          addToEventQueue(xevt);
View Full Code Here

      public void onEvent(String channelName, String eventName, String data) {

        ExchangeEvent xevt = null;
        try {
          Trade t = parseTrade(data);
          xevt = new DefaultExchangeEvent(ExchangeEventType.TRADE, data, t);
        } catch (IOException e) {
          log.error("JSON stream error", e);
        }
        if (xevt != null) {
          addToEventQueue(xevt);
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.service.streaming.DefaultExchangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.