Package com.barchart.feed.base.book.api

Examples of com.barchart.feed.base.book.api.MarketDoBook


      final TimeValue time) {

    assert entries != null;
    assert time != null;

    final MarketDoBook book = loadBook();

    book.setSnapshot(entries);

    eventAdd(NEW_BOOK_SNAPSHOT);

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here


      final TimeValue time) {

    assert entries != null;
    assert time != null;

    final MarketDoBook book = loadBook();

    book.clear();

    for (final MarketDoBookEntry entry : entries) {

      if (entry == null) {
        continue;
      }

      final UniBookResult result = book.setEntry(entry);

      switch (result) {
      case TOP:
      case NORMAL:
        break;
      default:
        eventAdd(NEW_BOOK_ERROR);
        log.error("result : {} entry : {}", result, entry);
        break;
      }

    }

    eventAdd(NEW_BOOK_SNAPSHOT);

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

  public void setBookUpdate(final MarketDoBookEntry entry,
      final TimeValue time) {

    assert entry != null && time != null;

    final MarketDoBook book = loadBook();

    final UniBookResult result = book.setEntry(entry);

    switch (result) {
    case TOP:
      eventAdd(NEW_BOOK_TOP);
      // continue
    case NORMAL:
      eventAdd(NEW_BOOK_UPDATE);
      break;
    default:
      eventAdd(NEW_BOOK_ERROR);
      final MarketInstrument inst = get(MarketField.INSTRUMENT);
      final TextValue id = inst.get(InstrumentField.ID);
      final TextValue comment = inst.get(InstrumentField.DESCRIPTION);
      log.error("instrument : {} : {}", id, comment);
      log.error("result : {} ; entry : {} ;", result, entry);
      return;
    }

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

      final TimeValue time) {
   
    assert entries != null;
    assert time != null;

    final MarketDoBook book = loadBook();

    book.setSnapshot(entries);

    eventAdd(NEW_BOOK_SNAPSHOT);

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

      final TimeValue time) {

    assert entries != null;
    assert time != null;

    final MarketDoBook book = loadBook();

    book.clear();

    for (final MarketDoBookEntry entry : entries) {

      if (entry == null) {
        continue;
      }

      final UniBookResult result = book.setEntry(entry);

      switch (result) {
      case TOP:
      case NORMAL:
        break;
      default:
        eventAdd(NEW_BOOK_ERROR);
        log.error("result : {} entry : {}", result, entry);
        break;
      }

    }

    eventAdd(NEW_BOOK_SNAPSHOT);

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

  public void setBookUpdate(final MarketDoBookEntry entry,
      final TimeValue time) {

    assert entry != null && time != null;

    final MarketDoBook book = loadBook();

    final UniBookResult result = book.setEntry(entry);

    switch (result) {
    case TOP:
      eventAdd(NEW_BOOK_TOP);
      // continue
    case NORMAL:
      eventAdd(NEW_BOOK_UPDATE);
      break;
    default:
      eventAdd(NEW_BOOK_ERROR);
      final CharSequence id = instrument.id().toString();
      final CharSequence comment = instrument.description();
      log.error("instrument : {} : {}", id, comment);
      log.error("result : {} ; entry : {} ;", result, entry);
      return;
    }

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

  public void setBookSnapshot(final MarketDoBookEntry[] entries, final TimeValue time) {

    assert entries != null;
    assert time != null;

    final MarketDoBook book = loadBook();

    book.setSnapshot(entries);

    setChange(Component.BOOK_COMBINED);
    eventAdd(NEW_BOOK_SNAPSHOT);

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

  public void setBookUpdate(final MarketDoBookEntry entry,
      final TimeValue time) {

    assert entry != null && time != null;

    final MarketDoBook book = loadBook();

    final UniBookResult result = book.setEntry(entry);

    switch (result) {
      case TOP:
        eventAdd(NEW_BOOK_TOP);
        // continue
      case NORMAL:
        eventAdd(NEW_BOOK_UPDATE);
        break;
      default:
        eventAdd(NEW_BOOK_ERROR);
        final CharSequence id = instrument.id().toString();
        final CharSequence comment = instrument.description();
        log.error("instrument : {} : {}", id, comment);
        log.error("result : {} ; entry : {} ;", result, entry);
        return;
    }

    book.setTime(time);
    setChange(Component.BOOK_COMBINED);
    updateMarket(time);

  }
View Full Code Here

      final TimeValue time) {

    assert entries != null;
    assert time != null;

    final MarketDoBook book = loadBook();

    book.setSnapshot(entries);

    eventAdd(NEW_BOOK_SNAPSHOT);

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

      final TimeValue time) {

    assert entries != null;
    assert time != null;

    final MarketDoBook book = loadBook();

    book.clear();

    for (final MarketDoBookEntry entry : entries) {

      if (entry == null) {
        continue;
      }

      final UniBookResult result = book.setEntry(entry);

      switch (result) {
      case TOP:
      case NORMAL:
        break;
      default:
        eventAdd(NEW_BOOK_ERROR);
        log.error("result : {} entry : {}", result, entry);
        break;
      }

    }

    eventAdd(NEW_BOOK_SNAPSHOT);

    book.setTime(time);
    updateMarket(time);

  }
View Full Code Here

TOP

Related Classes of com.barchart.feed.base.book.api.MarketDoBook

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.