Package com.opengamma.id

Examples of com.opengamma.id.ExternalId


                                                                              VersionCorrection.LATEST).getSecurity();
    assertFalse(updatedSecurity.isPayer());
    assertEquals(LongShort.LONG, updatedSecurity.getLongShort());
    assertEquals(Currency.CAD, updatedSecurity.getCurrency());

    ExternalId underlyingId = updatedSecurity.getUnderlyingId();
    SecuritySearchRequest searchRequest = new SecuritySearchRequest();
    searchRequest.setExternalIdSearch(new ExternalIdSearch(underlyingId));
    SecuritySearchResult searchResult = _securityMaster.search(searchRequest);
    SwapSecurity updatedUnderlying = (SwapSecurity) searchResult.getSingleSecurity();
    ZonedDateTime tradeDate = ZonedDateTime.of(LocalDateTime.of(2013, 1, 1, 11, 0), ZoneOffset.UTC);
View Full Code Here


  private String getBloombergEquitySymbol(final String base, final String member) {
    return member.split(" ")[0] + " " + base + BLOOMBERG_EQUITY_TICKER_SUFFIX;
  }

  private void addNodes(final ManageablePortfolioNode rootNode, final String underlying, final boolean includeUnderlying, final Period[] expiries) {
    final ExternalId ticker = ExternalSchemes.bloombergTickerSecurityId(underlying);
    ManageableSecurity underlyingSecurity = null;
    if (includeUnderlying) {
      underlyingSecurity = getOrLoadEquity(ticker);
    }
View Full Code Here

  }

  @Path("requirement/{valueName}/{targetType}/{targetId}")
  public DependencyGraphTraceProviderResource setValueRequirementByExternalId(@PathParam("valueName") final String valueName, @PathParam("targetType") final String targetType,
      @PathParam("targetId") final String targetId) {
    ExternalId externalId = ExternalId.parse(targetId);
    ValueRequirement valueRequirement = toValueRequirement(valueName, new ComputationTargetRequirement(ComputationTargetType.parse(targetType), externalId));
    DependencyGraphTraceBuilderProperties properties = _properties.addRequirement(valueRequirement);
    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
View Full Code Here

   */
  public CdsOptionReferenceNameAggregationFunction(final SecuritySource securitySource, final OrganizationSource organizationSource) {
    super(NAME, securitySource, new CdsOptionValueExtractor<Obligor>() {
      @Override
      public Obligor extract(CreditDefaultSwapOptionSecurity cdsOption) {
        ExternalId underlyingId = cdsOption.getUnderlyingId();
        Security underlying = securitySource.getSingle(underlyingId.toBundle());
        if (underlying instanceof AbstractCreditDefaultSwapSecurity) {
          String redCode = ((CreditDefaultSwapSecurity) underlying).getReferenceEntity().getValue();
          Organization organisation = organizationSource.getOrganizationByRedCode(redCode);
          return organisation.getObligor();
        } else {
View Full Code Here

    MarketDataSnapshotMaster marketDataSnapshotMaster = getServices().getSnapshotMaster();
    if (marketDataSnapshotMaster != null) {
      Iterator<Entry<ExternalId, Set<ObjectId>>> iterator = _marketDataSnapShots.entrySet().iterator();
      while (iterator.hasNext()) {
        Entry<ExternalId, Set<ObjectId>> entry = iterator.next();
        ExternalId identifier = entry.getKey();
        if (identifier.getScheme().getName().equals(userName)) {
          Set<ObjectId> oids = entry.getValue();
          for (ObjectId oid : oids) {
            marketDataSnapshotMaster.remove(oid);
            s_logger.debug("market data snapshot {} discarded for {}/{}", new Object[]{oid, userName, identifier.getValue()});
          }
          iterator.remove();
        }
      }
    }
View Full Code Here

    ConfigMaster configMaster = getServices().getConfigMaster();
    if (configMaster != null) {
      Iterator<Entry<ExternalId, Set<ObjectId>>> iterator = _viewDefinitionIds.entrySet().iterator();
      while (iterator.hasNext()) {
        Entry<ExternalId, Set<ObjectId>> entry = iterator.next();
        ExternalId identifier = entry.getKey();
        if (identifier.getScheme().getName().equals(userName)) {
          Set<ObjectId> viewDefinitions = entry.getValue();
          for (ObjectId viewDefinitionId : viewDefinitions) {
            configMaster.remove(viewDefinitionId);
            s_logger.debug("View definition {} discarded for {}/{}", new Object[]{viewDefinitionId, userName, identifier.getValue()});
          }
          iterator.remove();
        }
      }
    }
View Full Code Here

  @Override
  public InterpolatedYieldCurveSpecification buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
    final LocalDate curveDate = deserializer.fieldValueToObject(LocalDate.class, message.getByName(CURVE_DATE_FIELD));
    final String name = message.getString(NAME_FIELD);
    final Currency currency = deserializer.fieldValueToObject(Currency.class, message.getByName(CURRENCY_FIELD));
    final ExternalId region = deserializer.fieldValueToObject(ExternalId.class, message.getByName(REGION_FIELD));
    final Interpolator1D interpolator = deserializer.fieldValueToObject(Interpolator1D.class, message.getByName(INTERPOLATOR_FIELD));
    final List<FudgeField> resolvedStripFields = message.getAllByName(RESOLVED_STRIPS_FIELD);
    final List<FixedIncomeStripWithIdentifier> resolvedStrips = new ArrayList<FixedIncomeStripWithIdentifier>();
    for (final FudgeField resolvedStripField : resolvedStripFields) {
      resolvedStrips.add(deserializer.fieldValueToObject(FixedIncomeStripWithIdentifier.class, resolvedStripField));
View Full Code Here

    final int n = idsFields.size();
    if (namesFields.size() != n) {
      throw new IllegalStateException("Should have one configuration name per external id");
    }
    for (int i = 0; i < n; i++) {
      final ExternalId id = deserializer.fieldValueToObject(ExternalId.class, idsFields.get(i));
      final String configuration = (String) namesFields.get(i).getValue();
      idsToNames.put(id, configuration);
    }
    final ExposureFunctions functions = new ExposureFunctions(name, exposureFunctions, idsToNames);
    final FudgeField uniqueId = message.getByName(UNIQUE_ID_FIELD);
View Full Code Here

      @Override
      public EnergyForwardSecurityBean visitEnergyForwardSecurity(
        EnergyForwardSecurity security) {
        final EnergyForwardSecurityBean bean = createCommodityForwardSecurityBean(new EnergyForwardSecurityBean(), security);
        ExternalId underlying = security.getUnderlyingId();
        if (underlying != null) {
          bean.setUnderlying(externalIdToExternalIdBean(underlying));
        }
        return bean;
      }

      @Override
      public MetalForwardSecurityBean visitMetalForwardSecurity(
        MetalForwardSecurity security) {
        final MetalForwardSecurityBean bean = createCommodityForwardSecurityBean(new MetalForwardSecurityBean(), security);
        ExternalId underlying = security.getUnderlyingId();
        if (underlying != null) {
          bean.setUnderlying(externalIdToExternalIdBean(security.getUnderlyingId()));
        }
        return bean;
      }
View Full Code Here

    Currency currency = currencyBeanToCurrency(bean.getCurrency());
    ZonedDateTime firstObservationDate = zonedDateTimeBeanToDateTimeWithZone(bean.getFirstObservationDate());
    ZonedDateTime lastObservationDate = zonedDateTimeBeanToDateTimeWithZone(bean.getLastObservationDate());
    Frequency observationFrequency = frequencyBeanToFrequency(bean.getObservationFrequency());
    ExternalId region = externalIdBeanToExternalId(bean.getRegion());
    ZonedDateTime settlementDate = zonedDateTimeBeanToDateTimeWithZone(bean.getSettlementDate());
    ExternalId spotUnderlingId = externalIdBeanToExternalId(bean.getSpotUnderlyingIdentifier());

    return new EquityVarianceSwapSecurity(spotUnderlingId, currency, bean.getStrike(), bean.getNotional(),
        bean.isParameterisedAsVariance(), bean.getAnnualizationFactor(), firstObservationDate, lastObservationDate, settlementDate, region, observationFrequency);
  }
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.