Package com.opengamma.id

Examples of com.opengamma.id.ExternalIdBundleWithDates


    info.setDataField("DF");
    info.setDataSource("DS");
    info.setDataProvider("DP");
    info.setObservationTime("OT");
    ExternalIdWithDates id = ExternalIdWithDates.of(ExternalId.of("A", "B"), LocalDate.of(2011, 6, 30), null);
    ExternalIdBundleWithDates bundle = ExternalIdBundleWithDates.of(id);
    info.setExternalIdBundle(bundle);
    HistoricalTimeSeriesInfoDocument input = new HistoricalTimeSeriesInfoDocument(info);
    try {
      w.update(input);
      Assert.fail();
View Full Code Here


          s_logger.warn("valid to date not in yyyy-mm-dd format - {}", validToStr);
        }
      }
      identifiers.add(ExternalIdWithDates.of(tickerId, validFrom, validTo));
    }
    return new ExternalIdBundleWithDates(identifiers);
  }
View Full Code Here

        }
      } else {
        identifiers.add(identifierWithDates);
      }
    }
    return new ExternalIdBundleWithDates(identifiers);
  }
View Full Code Here

            info.setDataSource(dataSource);
            info.setObservationTime(s_provider2ObservationTime.get(dataProvider));
           
            ExternalId ticker = ExternalSchemes.bloombergTickerSecurityId("ticker" + i);
            ExternalId buid = ExternalSchemes.bloombergBuidSecurityId("buid" + i);
            final ExternalIdBundleWithDates bundleWithDates = ExternalIdBundleWithDates.of(ExternalIdWithDates.of(ticker),
                ExternalIdWithDates.of(buid));
            info.setExternalIdBundle(bundleWithDates);
            HistoricalTimeSeriesInfoDocument added = _htsMaster.add(new HistoricalTimeSeriesInfoDocument(info));
            assertNotNull(added);
            assertNotNull(added.getUniqueId());
           
            Map<ExternalIdBundle, LocalDateDoubleTimeSeries> resultMap = _historicalTimeSeriesProvider.getHistoricalTimeSeries(
                Collections.singleton(bundleWithDates.toBundle()), BloombergConstants.BLOOMBERG_DATA_SOURCE_NAME, dataProvider, dataField, LocalDateRange.of(start, end, true));
            LocalDateDoubleTimeSeries timeSeries = resultMap.get(bundleWithDates.toBundle());
            UniqueId tsUid = _htsMaster.updateTimeSeriesDataPoints(added.getInfo().getTimeSeriesObjectId(), timeSeries);
           
            HistoricalTimeSeries hts = _htsMaster.getTimeSeries(tsUid);
            assertNotNull(hts);
            assertEquals(timeSeries, hts.getTimeSeries());
View Full Code Here

   * @return the map of BIUD to unique identifier, not null
   */
  private Map<ExternalId, HistoricalTimeSeriesInfoDocument> extractBuids(Iterable<HistoricalTimeSeriesInfoDocument> documents) {
    Map<ExternalId, HistoricalTimeSeriesInfoDocument> buids = Maps.newHashMap();
    for (HistoricalTimeSeriesInfoDocument doc : documents) {
      ExternalIdBundleWithDates identifierBundleWithDates = doc.getInfo().getExternalIdBundle();
      ExternalIdBundle bundle = identifierBundleWithDates.toBundle();
      ExternalId buid = bundle.getExternalId(ExternalSchemes.BLOOMBERG_BUID);
      if (buid == null) {
        throw new OpenGammaRuntimeException("no buid for " + bundle);
      }
      buids.put(buid, doc);
View Full Code Here

  private void updateIdentifiers(
      Map<ExternalId, HistoricalTimeSeriesInfoDocument> buidDocMap,
      Map<ExternalId, ExternalIdBundleWithDates> buidToUpdated) {
    for (Entry<ExternalId, ExternalIdBundleWithDates> entry : buidToUpdated.entrySet()) {
      HistoricalTimeSeriesInfoDocument doc = buidDocMap.get(entry.getKey());
      ExternalIdBundleWithDates updatedId = entry.getValue();
      if (doc != null && doc.getInfo().getExternalIdBundle().equals(updatedId) == false) {
        doc.getInfo().setExternalIdBundle(updatedId);
        s_logger.debug("Updated {} with {}", doc.getUniqueId(), updatedId);
        _htsMaster.update(doc);
      }
View Full Code Here

    info.setDataField(dataField);
    info.setDataSource(OG_DATA_SOURCE);
    info.setDataProvider(OG_DATA_PROVIDER);
    info.setObservationTime(HistoricalTimeSeriesConstants.LONDON_CLOSE);
    final ExternalIdWithDates id = ExternalIdWithDates.of(identifier, null, null);
    final ExternalIdBundleWithDates bundle = ExternalIdBundleWithDates.of(id);
    info.setExternalIdBundle(bundle);
    return info;
  }
View Full Code Here

          continue;
        }
      }
     
      try {
        ExternalIdBundleWithDates bundleWithDates = parseIdentifiers(fieldData);
        if (bundleWithDates != null) {
          result.put(bloombergKeys.get(securityDes), bundleWithDates);
        }
      } catch (Exception e) {
        s_logger.error("Error parsing identifiers for security " + securityDes, e);
View Full Code Here

    }
    ExternalIdWithDates ticker = makeTickerIdentifier(fieldData);
    if (ticker != null) {
      identifiers.add(ticker);
    }
    return identifiers.isEmpty() null : new ExternalIdBundleWithDates(identifiers);
  }
View Full Code Here

    Map<ExternalId, ExternalIdBundleWithDates> externalId2WithDates = _identifierResolver.getExternalIds(identifiers);
   
    // reverse map and normalize identifiers
    for (Entry<ExternalId, ExternalIdBundleWithDates> entry : externalId2WithDates.entrySet()) {
      ExternalId requestIdentifier = entry.getKey();
      ExternalIdBundleWithDates bundle = entry.getValue();
      bundle = BloombergDataUtils.addTwoDigitYearCode(bundle);
      bundle2WithDates.put(bundle.toBundle(), bundle);
      withDates2ExternalId.put(bundle, requestIdentifier);
    }
   
    // fetch time-series and store to master
    if (bundle2WithDates.size() > 0) {
View Full Code Here

TOP

Related Classes of com.opengamma.id.ExternalIdBundleWithDates

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.