Package com.opengamma.bbg.referencedata.cache

Examples of com.opengamma.bbg.referencedata.cache.MongoDBValueCachingReferenceDataProvider


      csvReader = new CSVReader(new BufferedReader(new FileReader(args[0])));
      csvWriter = new CSVWriter(new BufferedWriter(new FileWriter(args[1])));
      String[] line;
      Pattern pattern = Pattern.compile("^(\\w\\w\\w).*?(\\d+)(M|Y)(\\d+)(M|Y)\\s*?(PY|RC)\\s*?(.*)$");
      BloombergReferenceDataProvider rawBbgRefDataProvider = getBloombergSecurityFileLoader();
      MongoDBValueCachingReferenceDataProvider bbgRefDataProvider = MongoCachedReferenceData.makeMongoProvider(rawBbgRefDataProvider, BloombergSwaptionFileLoader.class);
      while ((line = csvReader.readNext()) != null) {
        String name = line[NAME_FIELD];
        Matcher matcher = pattern.matcher(name);
        if (matcher.matches()) {
          String ccy = matcher.group(1);
          String swapTenorSize = matcher.group(2);
          String swapTenorUnit = matcher.group(3);
          String optionTenorSize = matcher.group(4);
          String optionTenorUnit = matcher.group(5);
          String payReceive = matcher.group(6);
          String distanceATM = matcher.group(7);
         
          String buid = "/buid/" + line[BUID_FIELD];
          String value = bbgRefDataProvider.getReferenceDataValue(buid, "TICKER");
          csvWriter.writeNext(new String[] {name, ccy, swapTenorSize, swapTenorUnit, optionTenorSize, optionTenorUnit, payReceive, distanceATM, value });
        } else {
          s_logger.error("Couldn't parse " + name + " field");
        }
       
View Full Code Here


   * @param makeUnique  whether to make the database totally unique
   * @return the wrapped provider, not null
   */
  public static MongoDBValueCachingReferenceDataProvider makeMongoProvider(ReferenceDataProvider underlying, Class<?> testClass, boolean makeUnique) {
    MongoConnector mongoConnector = getMongoConnector(testClass, makeUnique);
    MongoDBValueCachingReferenceDataProvider mongoProvider = new MongoDBValueCachingReferenceDataProvider(underlying, mongoConnector);
    return mongoProvider;
  }
View Full Code Here

   *
   * @return the provider, not null
   */
  public static ReferenceDataProvider getMongoCachingReferenceDataProvider(BloombergReferenceDataProvider bbgProvider) {
    MongoConnector mongoConnector = BloombergTestUtils.getMongoConnector();
    return new MongoDBValueCachingReferenceDataProvider(bbgProvider, mongoConnector);
  }
View Full Code Here

   
    MongoConnector mongoConnector = getMongoConnector();
    CacheManager cacheManager = getCacheManager();
    if (mongoConnector != null) {
      MongoDBInvalidFieldCachingReferenceDataProvider fieldCached = new MongoDBInvalidFieldCachingReferenceDataProvider(underlying, mongoConnector);
      return new MongoDBValueCachingReferenceDataProvider(fieldCached, mongoConnector);
     
    } else if (cacheManager != null) {
      ReferenceDataProvider fieldCached = new InMemoryInvalidFieldCachingReferenceDataProvider(underlying)// TODO: EHcached version
      return new EHValueCachingReferenceDataProvider(fieldCached, cacheManager);
     
View Full Code Here

TOP

Related Classes of com.opengamma.bbg.referencedata.cache.MongoDBValueCachingReferenceDataProvider

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.