rawRetObj = streamObjectMapper.readValue(data, CoinfloorOrderbook.class);
} catch (IOException e) {
throw new ExchangeException("JSON parse error", e);
}
resultMap.put("raw", rawRetObj);
OrderBook orderbook;
synchronized (cachedDataSynchronizationObject) {
List<LimitOrder> bidList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getBids());
List<LimitOrder> askList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getAsks());
List<CoinfloorOrder> orders = rawRetObj.getOrders();
if (orders != null) {
for (CoinfloorOrder order : orders) {
if (order.getBaseQty().doubleValue() > 0) {
bidList.add(adaptOrder(order));
}
else {
askList.add(adaptOrder(order));
}
}
}
orderbook = new OrderBook(new Date(), askList, bidList);
cachedOrderBook = orderbook;
}
resultMap.put("generic", orderbook);
return resultMap;