Package com.opengamma.id

Examples of com.opengamma.id.ExternalIdBundleWithDates


    for (Entry<ExternalIdBundle, LocalDateDoubleTimeSeries> entry : tsMap.entrySet()) {
      ExternalIdBundle identifers = entry.getKey();
      LocalDateDoubleTimeSeries timeSeries = entry.getValue();
      if (timeSeries != null && !timeSeries.isEmpty()) {
        ManageableHistoricalTimeSeriesInfo info = new ManageableHistoricalTimeSeriesInfo();
        ExternalIdBundleWithDates bundleWithDates = identifiersToBundleWithDates.get(identifers);
        info.setExternalIdBundle(bundleWithDates);
        info.setDataField(dataField);
        info.setDataSource(BLOOMBERG_DATA_SOURCE_NAME);
        ExternalIdBundle bundle = bundleWithDates.toBundle(LocalDate.now(OpenGammaClock.getInstance()));
        String idStr = Objects.firstNonNull(
            bundle.getValue(ExternalSchemes.BLOOMBERG_TICKER),
            Objects.firstNonNull(
              bundle.getExternalId(ExternalSchemes.BLOOMBERG_BUID),
              bundle.getExternalIds().iterator().next())).toString();
View Full Code Here


    if (data().getUriInfo().getQueryParameters().size() > 0) {
      ExternalIdWithDatesDisplayComparator comparator = ExternalIdWithDatesDisplayComparatorUtils.getComparator(data().getConfigSource(), ExternalIdDisplayComparatorUtils.DEFAULT_CONFIG_NAME);
      HistoricalTimeSeriesInfoSearchResult searchResult = data().getHistoricalTimeSeriesMaster().search(searchRequest);
      for (HistoricalTimeSeriesInfoDocument doc : searchResult.getDocuments()) {
        // replace ids with one's sorted the way we want.
        ExternalIdBundleWithDates withCustomIdOrdering = doc.getInfo().getExternalIdBundle().withCustomIdOrdering(comparator);
        doc.getInfo().setExternalIdBundle(withCustomIdOrdering);
      }
      out.put("searchResult", searchResult);
      out.put("paging", new WebPaging(searchResult.getPaging(), data().getUriInfo()));
    }
View Full Code Here

    Set<ExternalIdWithDates> ids = new HashSet<ExternalIdWithDates>();
    ExternalId buid = ExternalSchemes.bloombergBuidSecurityId("EO1005552010070180500001");
    ids.add(ExternalIdWithDates.of(buid, null, null));
    ExternalId tickerId = ExternalSchemes.bloombergTickerSecurityId("FMCC US 07/17/10 C2.5 Equity");
    ids.add(ExternalIdWithDates.of(tickerId, null, LocalDate.of(2010, Month.JULY, 17)));
    ExternalIdBundleWithDates expected = new ExternalIdBundleWithDates(ids);
   
    Collection<ExternalIdBundleWithDates> identifiers = _idProvider.getExternalIds(Collections.singleton(tickerId)).values();
    assertFalse(identifiers.isEmpty());
    assertEquals(expected, identifiers.iterator().next());
  }
View Full Code Here

  public void bondFuture() {
    Set<ExternalIdWithDates> ids = new HashSet<ExternalIdWithDates>();
    ids.add(ExternalIdWithDates.of(ExternalSchemes.bloombergBuidSecurityId("IX1562358-0"), null, null));
    ids.add(ExternalIdWithDates.of(ExternalSchemes.bloombergTickerSecurityId("USH02 Comdty"), LocalDate.of(2000, Month.DECEMBER, 20), LocalDate.of(2002, Month.MARCH, 19)));
    ids.add(ExternalIdWithDates.of(ExternalSchemes.cusipSecurityId("USH02"), LocalDate.of(2000, Month.DECEMBER, 20), LocalDate.of(2002, Month.MARCH, 19)));
    ExternalIdBundleWithDates expectedIds = new ExternalIdBundleWithDates(ids);
   
    Collection<ExternalIdBundleWithDates> bbgIds = _idProvider.getExternalIds(Collections.singleton(ExternalSchemes.bloombergTickerSecurityId("USH02 Comdty"))).values();
    assertFalse(bbgIds.isEmpty());
    assertEquals(expectedIds, bbgIds.iterator().next());
  }
View Full Code Here

    Set<ExternalIdWithDates> identifiers = Sets.newHashSet(
        ExternalIdWithDates.of(ExternalSchemes.bloombergTickerSecurityId("EDU0 Comdty"),
            LocalDate.of(2010, Month.SEPTEMBER, 14), LocalDate.of(2020, Month.SEPTEMBER, 14)),
        ExternalIdWithDates.of(ExternalSchemes.bloombergBuidSecurityId("IX11084074-0"), null, null));

    ExternalIdBundleWithDates withTwoDigits = BloombergDataUtils.addTwoDigitYearCode(new ExternalIdBundleWithDates(identifiers));
    assertTrue(withTwoDigits.size() == 3);
    for (ExternalIdWithDates identifierWithDates : identifiers) {
      assertTrue(withTwoDigits.contains(identifierWithDates));
    }
    assertTrue(withTwoDigits.contains(ExternalIdWithDates.of(
        ExternalSchemes.bloombergTickerSecurityId("EDU20 Comdty"),
        LocalDate.of(2010, Month.SEPTEMBER, 14), LocalDate.of(2020, Month.SEPTEMBER, 14))));
   
    identifiers = Sets.newHashSet(
        ExternalIdWithDates.of(ExternalSchemes.bloombergTickerSecurityId("EDU09 Comdty"),
            LocalDate.of(1999, Month.SEPTEMBER, 14), LocalDate.of(2009, Month.SEPTEMBER, 14)),
        ExternalIdWithDates.of(ExternalSchemes.bloombergBuidSecurityId("IX9471080-0"), null, null));
    withTwoDigits = BloombergDataUtils.addTwoDigitYearCode(new ExternalIdBundleWithDates(identifiers));
    assertTrue(withTwoDigits.size() == 3);
    for (ExternalIdWithDates identifierWithDates : identifiers) {
      assertTrue(withTwoDigits.contains(identifierWithDates));
    }
    assertTrue(withTwoDigits.contains(ExternalIdWithDates.of(
        ExternalSchemes.bloombergTickerSecurityId("EDU9 Comdty"),
        LocalDate.of(1999, Month.SEPTEMBER, 14), LocalDate.of(2009, Month.SEPTEMBER, 14))));
  }
View Full Code Here

        ExternalIdWithDates.of(ExternalSchemes.bloombergTickerSecurityId("EDU0 Comdty"),
            LocalDate.of(2010, Month.SEPTEMBER, 14), LocalDate.of(2020, Month.SEPTEMBER, 14)),
        ExternalIdWithDates.of(ExternalSchemes.bloombergBuidSecurityId("IX11084074-0"), null, null),
        ExternalIdWithDates.of(ExternalSchemes.cusipSecurityId("EDU0"), null, null));

    ExternalIdBundleWithDates expected = new ExternalIdBundleWithDates(identifiers);
   
    MutableFudgeMsg message = new FudgeContext().newMessage();
    message.add(FIELD_ID_BBG_UNIQUE, "IX11084074-0");
    message.add(FIELD_ID_CUSIP, "EDU0");
    message.add(FIELD_PARSEKYABLE_DES, "EDU0 Comdty");
    message.add(FIELD_FUT_FIRST_TRADE_DT, "2010-09-14");
    message.add(FIELD_FUT_LAST_TRADE_DT, "2020-09-14");
   
    ExternalIdBundleWithDates actual = BloombergDataUtils.parseIdentifiers(message, FIELD_FUT_FIRST_TRADE_DT, FIELD_FUT_LAST_TRADE_DT);
    assertEquals(expected, actual);
  }
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.