Package com.opengamma.id

Examples of com.opengamma.id.ExternalId


  @Override
  public CapFloorCMSSpreadSecurity createSecurity(final OperationContext context, CapFloorCMSSpreadSecurityBean bean) {
   
    ZonedDateTime startDate = zonedDateTimeBeanToDateTimeWithZone(bean.getStartDate());
    ZonedDateTime maturityDate = zonedDateTimeBeanToDateTimeWithZone(bean.getMaturityDate());
    ExternalId longIdentifier = externalIdBeanToExternalId(bean.getLongIdentifier());
    ExternalId shortIdentifier = externalIdBeanToExternalId(bean.getShortIdentifier());
    Frequency frequency = frequencyBeanToFrequency(bean.getFrequency());
    Currency currency = currencyBeanToCurrency(bean.getCurrency());
    DayCount dayCount = dayCountBeanToDayCount(bean.getDayCount());
    return new CapFloorCMSSpreadSecurity(startDate,
        maturityDate,
View Full Code Here


  @Override
  public CapFloorSecurity createSecurity(final OperationContext context, CapFloorSecurityBean bean) {
   
    ZonedDateTime startDate = zonedDateTimeBeanToDateTimeWithZone(bean.getStartDate());
    ZonedDateTime maturityDate = zonedDateTimeBeanToDateTimeWithZone(bean.getMaturityDate());
    ExternalId underlyingIdentifier = externalIdBeanToExternalId(bean.getUnderlyingIdentifier());
    Frequency frequency = frequencyBeanToFrequency(bean.getFrequency());
    Currency currency = currencyBeanToCurrency(bean.getCurrency());
    DayCount dayCount = dayCountBeanToDayCount(bean.getDayCount());
    return new CapFloorSecurity(startDate,
        maturityDate,
View Full Code Here

    for (final VolatilityPoint volatilityPoint : allPoints) {
      final Set<ExternalId> instruments = instrumentProvider.getInstruments(usd, volatilityPoint);
      Assert.assertNotNull(instruments);
      Assert.assertNotSame(0, instruments.size());

      final ExternalId strikeInstrument = instrumentProvider.getStrikeInstrument(usd, volatilityPoint.getSwapTenor(), volatilityPoint.getOptionExpiry());
      Assert.assertNotNull(strikeInstrument);
    }

  }
View Full Code Here

    Map<JmsTopicNameResolveRequest, String> returnValue = new HashMap<JmsTopicNameResolveRequest, String>();

    Map<String, Collection<JmsTopicNameResolveRequest>> lookupKey2Requests = new HashMap<String, Collection<JmsTopicNameResolveRequest>>();
   
    for (JmsTopicNameResolveRequest request : requests) {
      ExternalId marketDataUniqueId = request.getMarketDataUniqueId();
      if (!marketDataUniqueId.getScheme().equals(ExternalSchemes.BLOOMBERG_BUID)) {
        s_logger.info("No Bloomberg BUID found, was given: " + marketDataUniqueId);
        returnValue.put(request, null);
        continue;
      }
     
View Full Code Here

    Set<String> bbgKeys = new HashSet<String>();
    Map<String, Collection<ExternalIdBundle>> bbgKey2Bundle = new HashMap<String, Collection<ExternalIdBundle>>();
   
    for (ExternalIdBundle bundle : bundles) {
      String bbgUniqueId = null;
      ExternalId preferredIdentifier = BloombergDomainIdentifierResolver.resolvePreferredIdentifier(bundle);
      if (preferredIdentifier != null) {
        if (!preferredIdentifier.getScheme().equals(ExternalSchemes.BLOOMBERG_BUID)) {
         
          String bloombergKey = BloombergDomainIdentifierResolver.toBloombergKey(preferredIdentifier);
          bbgKeys.add(bloombergKey);
         
          Collection<ExternalIdBundle> bundlesForKey = bbgKey2Bundle.get(bloombergKey);
          if (bundlesForKey == null) {
            bundlesForKey = new ArrayList<ExternalIdBundle>();
            bbgKey2Bundle.put(bloombergKey, bundlesForKey);
          }
          bundlesForKey.add(bundle);
         
        } else {
          bbgUniqueId = preferredIdentifier.getValue();
          result.put(bundle, ExternalSchemes.bloombergBuidSecurityId(bbgUniqueId));
        }
      } else {
        s_logger.info("Unable to identify any Bloomberg compatible identifier for {}", bundle);
        result.put(bundle, null);
      }
    }
   
    Map<String, String> bbgKey2BbgUniqueId = ReferenceDataProviderUtils.getBloombergUniqueIDs(bbgKeys, getReferenceDataProvider());
   
    for (String bbgKey : bbgKey2Bundle.keySet()) {
      String bbgUniqueId = bbgKey2BbgUniqueId.get(bbgKey);
      
      ExternalId identifier;
      if (bbgUniqueId == null) {
        identifier = null;
      } else {
        identifier = ExternalSchemes.bloombergBuidSecurityId(bbgUniqueId);
      }
View Full Code Here

  private DistributionSpecification wrap(DistributionSpecification underResolved) {
    if (underResolved == null) {
      return null;
    }
    ExternalId identifier = underResolved.getMarketDataId();
    ExternalScheme wrappedScheme;
    if (identifier.getScheme().equals(ExternalSchemes.BLOOMBERG_BUID)) {
      wrappedScheme = ExternalSchemes.BLOOMBERG_BUID_WEAK;
    } else if (identifier.getScheme().equals(ExternalSchemes.BLOOMBERG_TICKER)) {
      wrappedScheme = ExternalSchemes.BLOOMBERG_TICKER_WEAK;     
    } else {
      throw new IllegalArgumentException("Unsupported scheme: " + identifier.getScheme());
    }
    ExternalId wrapped = ExternalId.of(wrappedScheme, identifier.getValue());
    return new DistributionSpecification(wrapped, underResolved.getNormalizationRuleSet(), underResolved.getJmsTopic().concat(".Fake"));
  }
View Full Code Here

 
  public void constructValueStores() {
    List<LastKnownValueStore> valueStores = new LinkedList<LastKnownValueStore>();
    for (int i = 0; i < NUM_SECURITIES; i++) {
      String idName = "Security-" + i;
      ExternalId id = ExternalId.of("PerformanceTest", idName);
      LastKnownValueStore store = _provider.newInstance(id, "Performance Test");
      valueStores.add(store);
     
      MutableFudgeMsg msg = FUDGE_CONTEXT.newMessage();
      for (int j = 0; j < NUM_FIELDS_PER_SECURITY; j++) {
View Full Code Here

    SecurityMaster securityMaster = mock(SecurityMaster.class);
    ExternalIdVisitor visitor = new ExternalIdVisitor(securityMaster);
    SwapSecurity swap = createSwap();
    UniqueId uid = UniqueId.of("test", "123");
    swap.setUniqueId(uid);
    ExternalId externalId = ExternalId.of(UniqueId.EXTERNAL_SCHEME, "345");
    swap.setExternalIdBundle(ExternalIdBundle.of(externalId));
    swap.accept(visitor);
    assertEquals(externalId, swap.getExternalIdBundle().getExternalId(UniqueId.EXTERNAL_SCHEME));
    verify(securityMaster, never()).update(any(SecurityDocument.class));
  }
View Full Code Here

    return null;
  }

  @Override
  public Void visitEnergyFutureSecurity(EnergyFutureSecurity security) {
    ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }
View Full Code Here

    return null;
  }

  @Override
  public Void visitIndexFutureSecurity(IndexFutureSecurity security) {
    ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }
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.