Package com.opengamma.id

Examples of com.opengamma.id.ExternalId


        liveDataSec2Identifier.put(liveDataSpecForBundle, entry.getValue());
      }
    }
     
    for (LiveDataSpecification liveDataSpec : liveDataSpecifications) {
      ExternalId identifier = liveDataSec2Identifier.get(liveDataSpec);
      NormalizationRuleSet normalizationRule = liveDataSec2NormalizationRule.get(liveDataSpec);
      if (identifier == null || normalizationRule == null) {
        liveDataSec2JmsTopicName.put(liveDataSpec, null);      
      } else {
        JmsTopicNameResolveRequest jmsTopicNameRequest = new JmsTopicNameResolveRequest(identifier, normalizationRule);
        jmsTopicNameRequests.add(jmsTopicNameRequest);
       
        Collection<LiveDataSpecification> liveDataSpecs = jmsTopicNameRequest2LiveDataSec.get(jmsTopicNameRequest);
        if (liveDataSpecs == null) {
          liveDataSpecs = new ArrayList<LiveDataSpecification>();
          jmsTopicNameRequest2LiveDataSec.put(jmsTopicNameRequest, liveDataSpecs);
        }
        liveDataSpecs.add(liveDataSpec);
      }
    }
   
    Map<JmsTopicNameResolveRequest, String> jmsTopicNames = _jmsTopicNameResolver.resolve(jmsTopicNameRequests);
    for (Map.Entry<JmsTopicNameResolveRequest, String> entry : jmsTopicNames.entrySet()) {
      Collection<LiveDataSpecification> liveDataSpecsForRequest = jmsTopicNameRequest2LiveDataSec.get(entry.getKey());
      for (LiveDataSpecification liveDataSpecForRequest : liveDataSpecsForRequest) {
        liveDataSec2JmsTopicName.put(liveDataSpecForRequest, entry.getValue());
      }
    }
   
    Map<LiveDataSpecification, DistributionSpecification> returnValue = new HashMap<LiveDataSpecification, DistributionSpecification>();

    for (LiveDataSpecification liveDataSpec : liveDataSpecifications) {
      ExternalId identifier = liveDataSec2Identifier.get(liveDataSpec);
      NormalizationRuleSet normalizationRule = liveDataSec2NormalizationRule.get(liveDataSpec);
      String jmsTopicName = liveDataSec2JmsTopicName.get(liveDataSpec);
      if (identifier == null || normalizationRule == null || jmsTopicName == null) {
        s_logger.info("Unable to resolve liveDataSpec: {} - identifier: {}, normalizationRule: {}, jmsTopicName: {}",
                      liveDataSpec, identifier, normalizationRule, jmsTopicName);
View Full Code Here


  private static final Notional NOTIONAL = new InterestRateNotional(Currency.USD, 10000);
  private static final boolean EOM = true;

  @Test
  public void testSwapSecurity() {
    final ExternalId referenceId = ExternalId.of("Test", "ASD");
    final SwapLeg payLeg = new FixedInterestRateLeg(DC, FREQUENCY, REGION_ID, BDC, NOTIONAL, EOM, 0.05);
    final SwapLeg receiveLeg = new FloatingInterestRateLeg(DC, FREQUENCY, REGION_ID, BDC, NOTIONAL, EOM, referenceId, FloatingRateType.OIS);
    final SwapSecurity security = new SwapSecurity(TRADE_DATE, EFFECTIVE_DATE, MATURITY, COUNTERPARTY, payLeg, receiveLeg);
    assertEncodeDecodeCycle(SwapSecurity.class, security);
  }
View Full Code Here

    FudgeMsg requestFudgeMsg = requestEnvelope.getMessage();
    ResolveRequest resolveRequest = ResolveRequest.fromFudgeMsg(deserializer, requestFudgeMsg);
    s_logger.debug("Received resolve request for {}", resolveRequest.getRequestedSpecification());
   
    LiveDataSpecification requestedSpec = resolveRequest.getRequestedSpecification();
    ExternalId resolvedId = _delegate.resolve(requestedSpec.getIdentifiers());
    LiveDataSpecification resolvedSpec = new LiveDataSpecification(
        requestedSpec.getNormalizationRuleSetId(),
        resolvedId);
   
    ResolveResponse response = new ResolveResponse(resolvedSpec);
View Full Code Here

    final DayCount thirty360 = DayCountFactory.INSTANCE.getDayCount("30/360");
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);

    final ExternalId dk = ExternalSchemes.financialRegionId("NO");

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);

    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("NKDR1T Curncy"), simpleNameSecurityId("NOK DEPOSIT 1d")), "NOK DEPOSIT 1d", act360,
        following, Period.ofDays(1), 0, false, dk);
View Full Code Here

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("SAONBOR Index"), simpleNameSecurityId("ZAR Jibor O/N")), "ZAR Jibor O/N",
        ACT_365, FOLLOWING, Period.ofDays(1), 0, false, ZA);
    for (int i = 1; i < 4; i++) {
      final String depositName = "ZAR Deposit " + i + "d";
      final ExternalId depositBbgId = bloombergTickerSecurityId("SADR" + i + BBG_DAY_CODE + " Curncy");
      final ExternalId depositSimpleId = simpleNameSecurityId(depositName);
      utils.addConventionBundle(ExternalIdBundle.of(depositBbgId, depositSimpleId), depositName, ACT_365, FOLLOWING, Period.ofDays(i), 0, false, ZA);
    }
    for (int i = 1; i < 4; i++) {
      final String depositName = "ZAR Deposit " + i + "w";
      final ExternalId depositBbgId = bloombergTickerSecurityId("SADR" + i + BBG_WEEK_CODE + " Curncy");
      final ExternalId depositSimpleId = simpleNameSecurityId(depositName);
      utils.addConventionBundle(ExternalIdBundle.of(depositBbgId, depositSimpleId), depositName, ACT_365, FOLLOWING, Period.ofDays(i * 7), 0, false, ZA);
    }
    for (int i = 1; i < 12; i++) {
      final String depositName = "ZAR Deposit " + i + "m";
      final ExternalId depositBbgId = bloombergTickerSecurityId("SADR" + BBG_MONTH_CODES[i - 1] + " Curncy");
      final ExternalId depositSimpleId = simpleNameSecurityId(depositName);
      utils.addConventionBundle(ExternalIdBundle.of(depositBbgId, depositSimpleId), depositName, ACT_365, FOLLOWING, Period.ofMonths(i), 0, false, ZA);
      final String jiborName = "ZAR Jibor " + i + "m";
      final ExternalId jiborBbgId = bloombergTickerSecurityId("JIBA" + i + "M Index");
      final ExternalId jiborSimpleId = simpleNameSecurityId(jiborName);
      utils.addConventionBundle(ExternalIdBundle.of(jiborBbgId, jiborSimpleId), jiborName, ACT_365, FOLLOWING, Period.ofMonths(i), 0, false, ZA);
    }
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("ZAR_3M_SWAP")), "ZAR_3M_SWAP", ACT_365, FOLLOWING,
        QUARTERLY, 2, ZA, ACT_365, FOLLOWING, QUARTERLY, 2, simpleNameSecurityId("ZAR Jibor 3m"), ZA, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("ZAR_3M_FRA")), "ZAR_3M_FRA", ACT_365, FOLLOWING,
View Full Code Here

   */
  public static synchronized void addFixedIncomeInstrumentConventions(final InMemoryConventionBundleMaster conventionMaster) {
    ArgumentChecker.notNull(conventionMaster, "convention master");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final DayCount act360 = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    final ExternalId ru = ExternalSchemes.financialRegionId("RU");

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);

    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDR1T Curncy"), simpleNameSecurityId("RUB DEPOSIT 1d")), "RUB DEPOSIT 1d", act360,
        following, Period.ofDays(1), 0, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDR2T Curncy"), simpleNameSecurityId("RUB DEPOSIT 2d")), "RUB DEPOSIT 2d", act360,
        following, Period.ofDays(1), 1, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDR3T Curncy"), simpleNameSecurityId("RUB DEPOSIT 3d")), "RUB DEPOSIT 3d", act360,
        following, Period.ofDays(1), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDR1Z Curncy"), simpleNameSecurityId("RUB DEPOSIT 1w")), "RUB DEPOSIT 1w", act360,
        following, Period.ofDays(7), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDR2Z Curncy"), simpleNameSecurityId("RUB DEPOSIT 2w")), "RUB DEPOSIT 2w", act360,
        following, Period.ofDays(14), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDR3Z Curncy"), simpleNameSecurityId("RUB DEPOSIT 3w")), "RUB DEPOSIT 3w", act360,
        following, Period.ofDays(21), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRA Curncy"), simpleNameSecurityId("RUB DEPOSIT 1m")), "RUB DEPOSIT 1m", act360,
        following, Period.ofMonths(1), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRB Curncy"), simpleNameSecurityId("RUB DEPOSIT 2m")), "RUB DEPOSIT 2m", act360,
        following, Period.ofMonths(2), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRC Curncy"), simpleNameSecurityId("RUB DEPOSIT 3m")), "RUB DEPOSIT 3m", act360,
        following, Period.ofMonths(3), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRD Curncy"), simpleNameSecurityId("RUB DEPOSIT 4m")), "RUB DEPOSIT 4m", act360,
        following, Period.ofMonths(4), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRE Curncy"), simpleNameSecurityId("RUB DEPOSIT 5m")), "RUB DEPOSIT 5m", act360,
        following, Period.ofMonths(5), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRF Curncy"), simpleNameSecurityId("RUB DEPOSIT 6m")), "RUB DEPOSIT 6m", act360,
        following, Period.ofMonths(6), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRG Curncy"), simpleNameSecurityId("RUB DEPOSIT 7m")), "RUB DEPOSIT 7m", act360,
        following, Period.ofMonths(7), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRH Curncy"), simpleNameSecurityId("RUB DEPOSIT 8m")), "RUB DEPOSIT 8m", act360,
        following, Period.ofMonths(8), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRI Curncy"), simpleNameSecurityId("RUB DEPOSIT 9m")), "RUB DEPOSIT 9m", act360,
        following, Period.ofMonths(9), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRJ Curncy"), simpleNameSecurityId("RUB DEPOSIT 10m")), "RUB DEPOSIT 10m", act360,
        following, Period.ofMonths(10), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDRK Curncy"), simpleNameSecurityId("RUB DEPOSIT 11m")), "RUB DEPOSIT 11m", act360,
        following, Period.ofMonths(11), 2, false, ru);
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("RRDR1 Curncy"), simpleNameSecurityId("RUB DEPOSIT 1y")), "RUB DEPOSIT 1y", act360,
        following, Period.ofYears(1), 2, false, ru);

    for (final int i : new int[] {1}) {
      final String name = "RUB IMPLIED DEPOSIT " + i + "w";
      final ExternalId tullett = tullettPrebonSecurityId("EMIDPRUBTOM" + i + "W");
      final ExternalId simple = simpleNameSecurityId(name);
      utils.addConventionBundle(ExternalIdBundle.of(tullett, simple), name, act360, following, Period.ofDays(i * 7), 2, false, ru);
    }

    for (final int i : new int[] {1, 2, 3, 6, 9, 18}) {
      final String name = "RUB IMPLIED DEPOSIT " + i + "m";
      final ExternalId tullett = tullettPrebonSecurityId("EMIDPRUBTOM" + (i < 10 ? "0" : "") + i + "M");
      final ExternalId simple = simpleNameSecurityId(name);
      utils.addConventionBundle(ExternalIdBundle.of(tullett, simple), name, act360, following, Period.ofMonths(i), 2, false, ru);
    }

    for (final int i : new int[] {1, 2, 3, 4, 5, 6, 7}) {
      final String name = "RUB IMPLIED DEPOSIT " + i + "y";
      ExternalId tullett;
      if (i == 1 || i == 2) {
        tullett = tullettPrebonSecurityId("EMIDPRUBTOM" + i * 12 + "M");
      } else {
        tullett = tullettPrebonSecurityId("EMIDPRUBTOM" + (i < 10 ? "0" : "") + i + "Y");
      }
      final ExternalId simple = simpleNameSecurityId(name);
      utils.addConventionBundle(ExternalIdBundle.of(tullett, simple), name, act360, following, Period.ofYears(i), 2, false, ru);
    }
  }
View Full Code Here

    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);

    //TODO holiday associated with EUR swaps is TARGET
    final ExternalId eu = ExternalSchemes.financialRegionId("EU");
    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);
    //EURO LIBOR
    utils.addConventionBundle(ExternalIdBundle.of(bloombergTickerSecurityId("EU00O/N Index"), simpleNameSecurityId("EUR LIBOR O/N"),
        tullettPrebonSecurityId("ASLIBEULONL")),
        "EUR LIBOR O/N", act360, following, Period.ofDays(1), 0, false, eu);
View Full Code Here

    }
    return new ExternalIdBean(identifier.getScheme().getName(), identifier.getValue());
  }
 
  public static CreditDefaultSwapIndexComponent cdsIndexComponentBeanToCDSIndexComponent(final CDSIndexComponentBean componentBean) {
    final ExternalId obligor = externalIdBeanToExternalId(componentBean.getObligor());
    final ExternalId bondId = externalIdBeanToExternalId(componentBean.getBondId());
    return new CreditDefaultSwapIndexComponent(componentBean.getName(), obligor, componentBean.getWeight(), bondId);
  }
View Full Code Here

  }

  @Override
  public StaticCurveInstrumentProvider buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
    final FudgeField instrumentIdentifier = message.getByName(INSTRUMENT_FIELD);
    final ExternalId identifier = deserializer.fieldValueToObject(ExternalId.class, instrumentIdentifier);
    if (message.hasField(DATA_FIELD) && message.hasField(TYPE_FIELD)) {
      final String dataField = message.getString(DATA_FIELD);
      final DataFieldType fieldType = DataFieldType.valueOf(message.getString(TYPE_FIELD));
      return new StaticCurveInstrumentProvider(identifier, dataField, fieldType);
    }
View Full Code Here

  }

  @Override
  public FRASecurity createSecurity(final OperationContext context, FRASecurityBean bean) {
    Currency currency = currencyBeanToCurrency(bean.getCurrency());
    ExternalId regionId = externalIdBeanToExternalId(bean.getRegion());
    ZonedDateTime startDate = zonedDateTimeBeanToDateTimeWithZone(bean.getStartDate());
    ZonedDateTime endDate = zonedDateTimeBeanToDateTimeWithZone(bean.getEndDate());
    double rate = bean.getRate();
    double amount = bean.getAmount();
    ExternalId underlyingId = externalIdBeanToExternalId(bean.getUnderlying());
    ZonedDateTime fixingDate = zonedDateTimeBeanToDateTimeWithZone(bean.getFixingDate());
    return new FRASecurity(currency, regionId, startDate, endDate, rate, amount, underlyingId, fixingDate);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.id.ExternalId

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.