Package com.opengamma.bbg.referencedata

Examples of com.opengamma.bbg.referencedata.ReferenceData


    _cache.save(wrap(identifier, invalidFields));
  }

  // wrap/unwrap of data here is rather weird...
  private ReferenceData wrap(String security, Set<String> permanentFailures) {
    ReferenceData wrapped = new ReferenceData(security);
    MutableFudgeMsg fieldData = _fudgeContext.newMessage();
    for (String fieldNames : permanentFailures) {
      fieldData.add(FIELD_PERMANENT_ERROR_NAME, fieldNames);
    }
    wrapped.setFieldValues(fieldData);
    return wrapped;
  }
View Full Code Here


      DBObject dbObject = cursor.next();
      s_logger.debug("dbObject={}", dbObject);
     
      String securityDes = (String) dbObject.get(SECURITY_DES_KEY_NAME);
      s_logger.debug("Have security data for des {} in MongoDB", securityDes);
      ReferenceData perSecResult = parseDBObject(serializer, securityDes, dbObject);
      if (result.put(securityDes, perSecResult) != null) {
        s_logger.warn("{}/{} Querying on des {} gave more than one document",
            new Object[] {_mongoConnector.getName(), _mongoCollection.getName(), securityDes });
      }
    }
View Full Code Here

    }
    return result;
  }

  private ReferenceData parseDBObject(FudgeSerializer serializer, String securityDes, DBObject fromDB) {
    ReferenceData result = new ReferenceData(securityDes);
    DBObject fieldData = (DBObject) fromDB.get(FIELD_DATA_KEY_NAME);
    result.setFieldValues(serializer.objectToFudgeMsg(fieldData));
    return result;
  }
View Full Code Here

    Set<String> securities = _cache.getAllCachedSecurities();
    Map<String, ReferenceData> loadCachedResults = _cache.load(securities);
   
    Set<String> chosen = new HashSet<String>();
    for (String candidate : securities) {
      ReferenceData cachedResult = loadCachedResults.get(candidate);
      if (cachedResult.getFieldValues().getByName(field) != null) {
        chosen.add(candidate);
      }
    }
    refreshCaches(chosen);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.bbg.referencedata.ReferenceData

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.