Package org.openfeed.proto.inst

Examples of org.openfeed.proto.inst.InstrumentDefinition


          log.debug("Starting remote lookup for {}", lookup);
         
          final String symbolURI = urlInstrumentLookup(lookup);
          final Element root = HelperXML.xmlDocumentDecode(symbolURI);
          final Element tag = xmlFirstChild(root, "instrument", XML_STOP);
          final InstrumentDefinition instDOM = InstrumentXML.decodeXML(tag);
         
          if(instDOM == null || instDOM == InstrumentDefinition.getDefaultInstance()) {
            log.trace("Empty instrument def returned from remote lookup: {}", lookup);
            failedRemoteQueue.add(lookup);
            return InstrumentDefinition.getDefaultInstance();
View Full Code Here


         
          for(final Future<Map<String, InstrumentDefinition>> f : futures) {
           
            for(final Entry<String, InstrumentDefinition> e : f.get().entrySet()) {
             
              final InstrumentDefinition def = e.getValue();
             
              if(def == null || def == InstrumentDefinition.getDefaultInstance()) {
                observer.onNext(new InstDefResult(e.getKey(),
                    new Throwable("Could not find " + e.getKey())));
              } else {
View Full Code Here

          if (qName != null && qName.equals("instrument")) {

            try {
             
              final String lookup = xmlStringDecode(ats, LOOKUP, XML_STOP);
              final InstrumentDefinition def = InstrumentXML.decodeSAX(ats);
             
              InstrumentState inst;
             
              if (def != InstrumentDefinition.getDefaultInstance()) {
                inst = InstrumentFactory.instrumentState(def);
View Full Code Here

         
          for(final Future<Map<String, InstrumentDefinition>> f : futures) {
           
            for(final Entry<String, InstrumentDefinition> e : f.get().entrySet()) {
             
              final InstrumentDefinition def = e.getValue();
             
              if(def == null || def == InstrumentDefinition.getDefaultInstance()) {
                observer.onNext(new InstDefResult(e.getKey(),
                    new Throwable("Could not find " + e.getKey())));
              } else {
View Full Code Here

 
  private void populateDB(final InputStream inStream) {
   
    long counter = 0;
    while(true) {
      InstrumentDefinition def;
     
      try {
        def = InstrumentDefinition.
            parseDelimitedFrom(inStream);
      } catch (Exception e) {
        e.printStackTrace();
        break;
      }
     
      if(def!= null) {
       
        if(def.hasSymbol()) {
          map.put(def.getSymbol(), def);
        }
       
        if(counter % 10000 == 0) {
          System.out.println("Build count " + counter);
        }
View Full Code Here

          log.debug("Starting remote lookup for {}", lookup);
         
          final String symbolURI = urlInstrumentLookup(lookup);
          final Element root = HelperXML.xmlDocumentDecode(symbolURI);
          final Element tag = xmlFirstChild(root, "instrument", XML_STOP);
          final InstrumentDefinition instDOM = InstrumentXML.decodeXML(tag);
         
          if(instDOM == null || instDOM == InstrumentDefinition.getDefaultInstance()) {
            log.warn("Empty instrument def returned from remote lookup: {}", lookup);
            failedRemoteQueue.add(lookup);
            return InstrumentDefinition.getDefaultInstance();
View Full Code Here

        inStream = zFile.getInputStream(entry);
       
        map.clear();
       
        long counter = 0;
        InstrumentDefinition def = null;
        while(true) {
          def = null;
         
          try {
            def = InstrumentDefinition.
                parseDelimitedFrom(inStream);
          } catch (final Exception e) {
            break;
          }
         
          if(def!= null) {
           
            if(def.hasSymbol()) {
              map.put(def.getSymbol(), def);
            }
           
            if(counter % 100000 == 0) {
              log.debug("Instrument DB build count " + counter);
            }
View Full Code Here

         
          for(final Future<Map<String, InstrumentDefinition>> f : futures) {
           
            for(final Entry<String, InstrumentDefinition> e : f.get().entrySet()) {
             
              final InstrumentDefinition def = e.getValue();
             
              if(def == null || def == InstrumentDefinition.getDefaultInstance()) {
                observer.onNext(new InstDefResult(e.getKey(),
                    new Throwable("Could not find " + e.getKey())));
              } else {
View Full Code Here

        if (qName != null && qName.equals("instrument")) {

          try {

            final String lookup = xmlStringDecode(ats, LOOKUP, XML_STOP);
            final InstrumentDefinition def = InstrumentXML.decodeSAX(ats);

            InstrumentState inst;

            if (def != InstrumentDefinition.getDefaultInstance()) {
              inst = InstrumentFactory.instrumentState(def);
View Full Code Here

         
          for(final Future<Map<String, InstrumentDefinition>> f : futures) {
           
            for(final Entry<String, InstrumentDefinition> e : f.get().entrySet()) {
             
              final InstrumentDefinition def = e.getValue();
             
              if(def == null || def == InstrumentDefinition.getDefaultInstance()) {
                observer.onNext(new InstDefResult(e.getKey(),
                    new Throwable("Could not find " + e.getKey())));
              } else {
View Full Code Here

TOP

Related Classes of org.openfeed.proto.inst.InstrumentDefinition

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.