Examples of DDF_MarketBase


Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if(!message.getMessageType().isMarketMessage) {
      return false;
    }
   
    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;
   
    /* Filter by instrument */
    if(subscriptions.containsKey(marketMsg.getInstrument().symbol())) {
     
      return true;
    }
   
    return false;
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if(!message.getMessageType().isMarketMessage) {
      return false;
    }
   
    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;
   
    /* Filter by instrument */
    if(subscriptions.containsKey(marketMsg.getInstrument().symbol())) {
     
      return true;
    }
   
    return false;
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if(!message.getMessageType().isMarketMessage) {
      return false;
    }
   
    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;
   
    /* Filter by instrument */
    if(subscriptions.containsKey(marketMsg.getInstrument().symbol())) {
     
      return true;
    }
   
    return false;
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if (!message.getMessageType().isMarketMessage) {
      return false;
    }

    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;

    /* Filter by instrument */
    if (subscriptions.containsKey(marketMsg.getInstrument()
        .symbol())) {
      return true;
    }

    return false;
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if(!message.getMessageType().isMarketMessage) {
      return false;
    }
   
    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;
   
    /* Filter by instrument */
    if(subscriptions.containsKey(marketMsg.getInstrument().get(
        DDF_InstrumentField.DDF_SYMBOL_REALTIME).toString())) {
     
      return true;
    }
   
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if(!message.getMessageType().isMarketMessage) {
      return false;
    }
   
    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;
   
    /* Filter by instrument */
    if(subscriptions.containsKey(marketMsg.getInstrument().get(
        DDF_InstrumentField.DDF_SYMBOL_REALTIME).toString())) {
     
      return true;
    }
   
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if (!message.getMessageType().isMarketMessage) {
      return false;
    }

    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;

    /* Filter by instrument */
    if (subscriptions.containsKey(marketMsg.getInstrument()
        .get(DDF_InstrumentField.DDF_SYMBOL_REALTIME).toString())) {
      return true;
    }

    return false;
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

          continue;
        }

        if (decoded instanceof DDF_MarketBase) {

          final DDF_MarketBase marketMessage =
              (DDF_MarketBase) decoded;

          final long time = marketMessage.getTime().asMillisUTC();

          if (time > maxTime) {

            // Auto-generated timestamp, skip if not previously
            // in range
            if (!inRange) {
              continue;
            }

          } else {

            // Before range start, skip
            if (start != null && time <= start.getTime()) {
              continue;
            }

            // After range end, completed
            if (end != null && time >= end.getTime()) {
              return;
            }

            inRange = true;

          }

          if (listener != null) {
            listener.messageProcessed(decoded, message);
          }

          if (speed > 0) {

            if (baseline == 0) {

              // Set baseline time difference
              baseline = time;
              adjustment = System.currentTimeMillis() - baseline;

            } else {

              final double delay = (time - baseline) * speed;
              final double elapsed =
                  (System.currentTimeMillis() - (baseline + adjustment))
                      * speed;

              if (delay > elapsed) {
                try {
                  Thread.sleep((long) (delay - elapsed));
                } catch (final InterruptedException e) {
                  e.printStackTrace();
                }
              }
            }

          }

          // log.debug(marketMessage.toString());

          if (marketplace != null) {
            if (symbols.size() == 0
                || symbols.contains(marketMessage.getSymbol()
                    .getName())) {
              marketplace.make(marketMessage);
            }
          }

View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

        new InlineExecutorService());
  }

  public void handleMessage(final DDF_BaseMessage message) {
    if (message instanceof DDF_MarketBase) {
      final DDF_MarketBase marketMessage = (DDF_MarketBase) message;
      maker.make(marketMessage);
    }
  }
View Full Code Here

Examples of com.barchart.feed.ddf.message.api.DDF_MarketBase

    /* Filter by market message */
    if(!message.getMessageType().isMarketMessage) {
      return false;
    }
   
    final DDF_MarketBase marketMsg = (DDF_MarketBase) message;
   
    /* Filter by instrument */
    if(subscriptions.containsKey(marketMsg.getInstrument().get(
        DDF_InstrumentField.DDF_SYMBOL_REALTIME).toString())) {
     
      return true;
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.