Package com.opengamma

Examples of com.opengamma.DataNotFoundException


  public PortfolioDocument get(ObjectIdentifiable objectId, VersionCorrection versionCorrection) {
    ArgumentChecker.notNull(objectId, "objectId");
    ArgumentChecker.notNull(versionCorrection, "versionCorrection");
    final PortfolioDocument document = _store.get(objectId.getObjectId());
    if (document == null) {
      throw new DataNotFoundException("Portfolio not found: " + objectId);
    }
    return clonePortfolioDocument(document);
  }
View Full Code Here


   
    final UniqueId uniqueId = document.getUniqueId();
    final Instant now = Instant.now();
    final PortfolioDocument storedDocument = _store.get(uniqueId.getObjectId());
    if (storedDocument == null) {
      throw new DataNotFoundException("Portfolio not found: " + uniqueId);
    }
   
    final PortfolioDocument clonedDoc = clonePortfolioDocument(document);
    removeNodes(storedDocument.getPortfolio().getRootNode());
   
View Full Code Here

    return document;
  }

  private void removeNodes(ManageablePortfolioNode node) {
    if (_storeNodes.remove(node.getUniqueId().getObjectId()) == null) {
      throw new DataNotFoundException("Node not found: " + node.getUniqueId());
    }
    for (ManageablePortfolioNode childNode : node.getChildNodes()) {
      removeNodes(childNode);
    }
  }
View Full Code Here

  @Override
  public void remove(ObjectIdentifiable objectIdentifiable) {
    ArgumentChecker.notNull(objectIdentifiable, "objectIdentifiable");
    PortfolioDocument storedDocument = _store.remove(objectIdentifiable.getObjectId());
    if (storedDocument == null) {
      throw new DataNotFoundException("Portfolio not found " + objectIdentifiable);
    }
    removeNodes(storedDocument.getPortfolio().getRootNode());
    _changeManager.entityChanged(ChangeType.REMOVED, objectIdentifiable.getObjectId(), null, null, Instant.now());
  }
View Full Code Here

  @Override
  public ManageablePortfolioNode getNode(UniqueId nodeId) {
    ArgumentChecker.notNull(nodeId, "nodeId");
    ManageablePortfolioNode node = _storeNodes.get(nodeId.getObjectId());
    if (node == null) {
      throw new DataNotFoundException("Node not found: " + nodeId);
    }
    return clonePortfolioNode(node);
  }
View Full Code Here

  public ExchangeDocument get(final ObjectIdentifiable objectId, final VersionCorrection versionCorrection) {
    ArgumentChecker.notNull(objectId, "objectId");
    ArgumentChecker.notNull(versionCorrection, "versionCorrection");
    final ExchangeDocument document = _store.get(objectId.getObjectId());
    if (document == null) {
      throw new DataNotFoundException("Exchange not found: " + objectId);
    }
    return document;
  }
View Full Code Here

    final UniqueId uniqueId = document.getUniqueId();
    final Instant now = Instant.now();
    final ExchangeDocument storedDocument = _store.get(uniqueId.getObjectId());
    if (storedDocument == null) {
      throw new DataNotFoundException("Exchange not found: " + uniqueId);
    }
    document.setVersionFromInstant(now);
    document.setVersionToInstant(null);
    document.setCorrectionFromInstant(now);
    document.setCorrectionToInstant(null);
View Full Code Here

  //-------------------------------------------------------------------------
  @Override
  public void remove(final ObjectIdentifiable objectIdentifiable) {
    ArgumentChecker.notNull(objectIdentifiable, "objectIdentifiable");
    if (_store.remove(objectIdentifiable.getObjectId()) == null) {
      throw new DataNotFoundException("Exchange not found: " + objectIdentifiable);
    }
    _changeManager.entityChanged(ChangeType.REMOVED, objectIdentifiable.getObjectId(), null, null, Instant.now());
  }
View Full Code Here

    }
    ExternalIdBundle externalId = link.getExternalId();
    if (externalId.isEmpty() == false) {
      return getSecurity(externalId);
    }
    throw new DataNotFoundException("Link " + link + " does not contain any references");
  }
View Full Code Here

  @Override
  public Security getSecurity(ExternalIdBundle bundle) {
    ArgumentChecker.notNull(bundle, "bundle");
    Collection<? extends Security> securities = getSecuritySource().get(bundle, getVersionCorrection());
    if (securities.isEmpty()) {
      throw new DataNotFoundException("Security not found: " + bundle + " at " + getVersionCorrection());
    }
    return selectBestMatch(securities);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.DataNotFoundException

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.