Package com.opengamma.id

Examples of com.opengamma.id.ExternalIdBundle


    assertEquals(null, test.getCorrectionToInstant());
    ManageablePosition testPosition = test.getPosition();
    assertNotNull(testPosition);
    assertEquals(uniqueId, testPosition.getUniqueId());
    assertEquals(BigDecimal.TEN, testPosition.getQuantity());
    ExternalIdBundle secKey = testPosition.getSecurityLink().getExternalId();
    assertEquals(1, secKey.size());
    assertTrue(secKey.getExternalIds().contains(ExternalId.of("A", "B")));
   
    assertNotNull(testPosition.getTrades());
    assertEquals(1, testPosition.getTrades().size());
    ManageableTrade testTrade = testPosition.getTrades().get(0);
    assertNotNull(testTrade);
View Full Code Here


    assertEquals(null, test.getCorrectionToInstant());
    ManageablePosition testPosition = test.getPosition();
    assertNotNull(testPosition);
    assertEquals(uniqueId, testPosition.getUniqueId());
    assertEquals(BigDecimal.TEN, testPosition.getQuantity());
    ExternalIdBundle secKey = testPosition.getSecurityLink().getExternalId();
    assertEquals(1, secKey.size());
    assertTrue(secKey.getExternalIds().contains(ExternalId.of("A", "B")));
   
    assertNotNull(testPosition.getTrades());
    assertEquals(1, testPosition.getTrades().size());
    ManageableTrade testTrade = testPosition.getTrades().get(0);
    assertNotNull(testTrade);
View Full Code Here

    assertEquals(null, test.getCorrectionToInstant());
    ManageablePosition testPosition = test.getPosition();
    assertNotNull(testPosition);
    assertEquals(portfolioId, testPosition.getUniqueId());
    assertEquals(BigDecimal.TEN, testPosition.getQuantity());
    ExternalIdBundle secKey = testPosition.getSecurityLink().getExternalId();
    assertEquals(1, secKey.size());
    assertTrue(secKey.getExternalIds().contains(ExternalId.of("A", "B")));
   
    assertNotNull(testPosition.getTrades());
    assertTrue(testPosition.getTrades().size() == 2);
    for (ManageableTrade testTrade : testPosition.getTrades()) {
      assertNotNull(testTrade);
View Full Code Here

    assertEquals(null, test.getCorrectionToInstant());
    ManageablePosition testPosition = test.getPosition();
    assertNotNull(testPosition);
    assertEquals(uniqueId, testPosition.getUniqueId());
    assertEquals(BigDecimal.TEN, testPosition.getQuantity());
    ExternalIdBundle secKey = testPosition.getSecurityLink().getExternalId();
    assertEquals(1, secKey.size());
    assertTrue(secKey.getExternalIds().contains(ExternalId.of("A", "B")));
   
    assertNotNull(testPosition.getTrades());
    assertEquals(1, testPosition.getTrades().size());
    ManageableTrade testTrade = testPosition.getTrades().get(0);
    assertNotNull(testTrade);
View Full Code Here

    final ManageableUnstructuredMarketDataSnapshot globalValues = new ManageableUnstructuredMarketDataSnapshot();
    snapshot1.setGlobalValues(globalValues);

    final HashMap<YieldCurveKey, YieldCurveSnapshot> yieldCurves = new HashMap<YieldCurveKey, YieldCurveSnapshot>();

    final ExternalIdBundle specA = ExternalId.of("XXX", "AAA").toBundle();
    final ExternalIdBundle specB = ExternalIdBundle.of(ExternalId.of("XXX", "B1"), ExternalId.of("XXX", "B2"));

    globalValues.putValue(specA, "X", new ValueSnapshot(Double.valueOf(12), null));
    globalValues.putValue(specA, "Y", new ValueSnapshot(Double.valueOf(1), null));
    globalValues.putValue(specA, "Z", new ValueSnapshot(null, null));
    globalValues.putValue(specB, "X", new ValueSnapshot(Double.valueOf(12), Double.valueOf(11)));
View Full Code Here

      Set<ValueSpecification> resolvedValues = Sets.newHashSet();
      for (ComputedValue computedValue : results.getAllMarketData()) {
        resolvedValues.add(computedValue.getSpecification());
        final DependencyNode nodeProducing = graph.getNodeProducing(computedValue.getSpecification());
        if ((nodeProducing != null) && isTerminalUnstructuredOutput(nodeProducing, graph)) {
          ExternalIdBundle identifiers = resolveExternalIdBundle(resolver, computedValue.getSpecification());
          if (identifiers != null) {
            snapshot.putValue(identifiers, computedValue.getSpecification().getValueName(), new ValueSnapshot(computedValue.getValue()));
          }
        }
      }
      //missing values go over the wire as nulls
      SetView<ValueSpecification> missingValues = Sets.difference(graph.getAllRequiredMarketData(), resolvedValues);
      for (ValueSpecification missingValue : missingValues) {
        ExternalIdBundle missingExternalIdBundle = resolveExternalIdBundle(resolver, missingValue);
        snapshot.putValue(missingExternalIdBundle, missingValue.getValueName(), null);
      }
    }
    return snapshot;
  }
View Full Code Here

    }
    return snapshot;
  }

  private ExternalIdBundle resolveExternalIdBundle(final ExternalIdBundleResolver resolver, ValueSpecification valueSpec) {
    ExternalIdBundle identifiers = resolver.visitComputationTargetSpecification(valueSpec.getTargetSpecification());
    // if reading live data from hts, we need to lookup the externalIdBundle via the hts unique id
    if (identifiers == null && _htsSource != null && valueSpec.getTargetSpecification().getUniqueId() != null) {
      // try a lookup in hts
      identifiers = _htsSource.getExternalIdBundle(valueSpec.getTargetSpecification().getUniqueId());
    }
View Full Code Here

  @Override
  public Void visitBondFutureSecurity(BondFutureSecurity security) {
    List<BondFutureDeliverable> basketList = security.getBasket();
    for (BondFutureDeliverable deliverable : basketList) {
      ExternalIdBundle identifiers = deliverable.getIdentifiers();
      if (identifiers != null) {
        _underlyings.add(identifiers);
      }
    }
    return null;
View Full Code Here

  }

  private ValueRequirement getRequirement(final ExternalIdBundleResolver resolver, final CurrencyMatrixValueRequirement valueRequirement, final ValueProperties constraints) {
    final ValueRequirement requirement = valueRequirement.getValueRequirement();
    // TODO: PLAT-2813 Don't perform the resolution here; request the time series directly
    final ExternalIdBundle targetIdentifiers = resolver.getExternalIdBundle(requirement.getTargetReference());
    if (targetIdentifiers == null) {
      return null;
    }
    final HistoricalTimeSeriesResolutionResult timeSeries = getHistoricalTimeSeriesResolver().resolve(targetIdentifiers, null, null, null, MarketDataRequirementNames.MARKET_VALUE, null);
    if (timeSeries == null) {
View Full Code Here

  public void setDefaultClient(LiveDataClient defaultClient) {
    _defaultClient = defaultClient;
  }
 
  protected LiveDataClient identifyUnderlying(LiveDataSpecification specification) {
    ExternalIdBundle idBundle = specification.getIdentifiers();
   
    for (ExternalId id : idBundle.getExternalIds()) {
      LiveDataClient underlying = _underlyingClients.get(id.getScheme().getName());
      if (underlying != null) {
        s_logger.debug("Delegating {} to {}", specification, underlying);
        return underlying;
      }
View Full Code Here

TOP

Related Classes of com.opengamma.id.ExternalIdBundle

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.