Package com.barchart.feed.api.model.meta

Examples of com.barchart.feed.api.model.meta.Instrument


            final Set<String> newInterests = new HashSet<String>();
           
            for (final Entry<String, List<Instrument>> e : instMap.entrySet()) {
             
              /* Currently assuming we're only getting one inst back */
              final Instrument i = e.getValue().get(0);
         
              if (!i.isNull()) {
         
                exInsts.remove(i);
                incInsts.add(i);
               
                /* We have to use an alternate symbol for options
                 * ...rolls eyes...
                 */
                final String symbol = i.symbol();
                if(symbol.contains("|")) {
                  newInterests.add(i.vendorSymbols().get(VendorID.BARCHART));
                } else {
                  newInterests.add(formatForJERQ(i.symbol()));
                }
               
              } else {
                /*
                 * For all failed lookups, store symbol and attempt to match
View Full Code Here


            final Set<String> oldInterests = new HashSet<String>();
           
            for (final Entry<String, List<Instrument>> e : instMap.entrySet()) {
             
              /* Currently assuming we're only getting one inst back */
              final Instrument i = e.getValue().get(0);
         
              if (!i.isNull()) {
         
                incInsts.remove(i);
                exInsts.add(i);
               
                /* We have to use an alternate symbol for options
                 * ...rolls eyes...
                 */
                final String symbol = i.symbol();
                if(symbol.contains("|")) {
                  oldInterests.add(i.vendorSymbols().get(VendorID.BARCHART));
                } else {
                  oldInterests.add(formatForJERQ(i.symbol()));
                }
               
              } else {
                /*
                 * For all failed lookups, store symbol and attempt to match
View Full Code Here

        default:
          // Ignore
          continue;
        case INSTRUMENT:
         
          final Instrument i = (Instrument)m;
         
          incInsts.add(i);
          exInsts.remove(i);
         
          /* We have to use an alternate symbol for options
           * ...rolls eyes...
           */
          final String symbol = i.symbol();
          if(symbol.contains("|")) {
            newInterests.add(i.vendorSymbols().get(VendorID.BARCHART));
          } else {
            newInterests.add(formatForJERQ(i.symbol()));
          }
         
          continue;
        case EXCHANGE:
          incExchanges.add((Exchange)m);
View Full Code Here

        default:
          // Ignore
          continue;
        case INSTRUMENT:
         
          final Instrument i = (Instrument)m;
         
          exInsts.add(i);
          incInsts.remove(i);
         
          /* We have to use an alternate symbol for options
           * ...rolls eyes...
           */
          final String symbol = i.symbol();
          if(symbol.contains("|")) {
            oldInterests.add(i.vendorSymbols().get(VendorID.BARCHART));
          } else {
            oldInterests.add(formatForJERQ(i.symbol()));
          }
         
          continue;
        case EXCHANGE:
          exExchanges.add((Exchange)m);
View Full Code Here

      final Set<String> newInterests = new HashSet<String>();

      for (final Entry<String, Instrument> e : instMap
          .entrySet()) {

        final Instrument i = e.getValue();

        if (!i.isNull()) {

          exInsts.remove(i);
          incInsts.add(i);
         
          newInterests.add(formatForJERQ(i.symbol()));
         
        } else {
          /*
           * For all failed lookups, store symbol and attempt to match
           * in the hasMatch method.
View Full Code Here

      final Set<String> oldInterests = new HashSet<String>();

      for (final Entry<String, Instrument> e : instMap
          .entrySet()) {

        final Instrument i = e.getValue();

        if (!i.isNull()) {

          incInsts.remove(i);
          exInsts.add(i);

          oldInterests.add(i.symbol());
         
        } else {
          /*
           * For all failed lookups, store symbol and attempt to match
           * in the hasMatch method.
View Full Code Here

  // ######################## Make ########################
 
  @Override
  public void make(final Message message) {

    final Instrument instrument = message.getInstrument();

    if (!isValid(instrument)) {
      return;
    }

    MarketDo market = marketMap.get(instrument.id());

    final boolean valid = isValid(market);
   
    if(!valid) {
      register(instrument);
      market = marketMap.get(instrument.id());
    }

    market.runSafe(safeMake, message);
   
    /* Below is a hack to keep the subscriptions updated */
    /* If a new market is created, a new subscription is made,
     * but it needs the State enum from market which should
     * get set on the first market snapshot, which is why
     * this comes after the above safeRun update of the message */
   
    /* If the state hasn't been set, this will mark it as Delayed,
     * and we're not updating */
    Subscription.Lense lense;
    if(market.get(MarketField.STATE).contains(
        MarketStateEntry.IS_PUBLISH_REALTIME)) {
      lense = Subscription.Lense.REALTIME;
    } else if(market.get(MarketField.STATE).contains(
        MarketStateEntry.IS_PUBLISH_DELAYED)) {
      lense = Subscription.Lense.DELAYED;
    } else {
      lense = Subscription.Lense.NULL;
    }
   
    if(!valid) {
      log.debug("Adding Subscription to map for {}", instrument.symbol());
      varSubs.put(instrument.id(), new VarSubscription(instrument, lense));
      defSubs.put(instrument.id(), varSubs.get(instrument.id()));
    }
   
    varSubs.get(instrument.id()).setLense(lense);

  }
View Full Code Here

  private static final Map<String, Instrument> cqgMap =
            new HashMap<String, Instrument>();

  public static Instrument findCQG(final String symbol) {
     
     Instrument result = cqgMap.get(symbol);
     
      if(result == null) {
             
            try {
                String barSymbol = remoteCQGLookup(symbol.toString());
               
                // ************** TODO
                //result = find(barSymbol);
               
                if(result == null || result.isNull()) {
                    log.warn("Unable to find barchart instrument for {}", symbol);
                    return Instrument.NULL;
                }
               
                cqgMap.put(symbol, result);
View Full Code Here

  // ########################

  @Override
  public void make(final Message message) {

    final Instrument instrument = message.getInstrument();

    if (!isValid(instrument)) {
      return;
    }

    MarketDo market = marketMap.get(instrument.id());

    if (!isValid(market)) {
      register(instrument);
      market = marketMap.get(instrument.id());
    }

    market.runSafe(safeMake, message);

  }
View Full Code Here

  // ########################
 
  @Override
  public void make(final Message message) {

    final Instrument instrument = message.getInstrument();

    if (!isValid(instrument)) {
      return;
    }
View Full Code Here

TOP

Related Classes of com.barchart.feed.api.model.meta.Instrument

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.