/**
 * Copyright (C) 2009 - 2010 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.engine.position;

import java.util.Set;

import com.opengamma.id.UniqueIdentifier;

/**
 * A master structure of all positions held by the organization.
 * <p>
 * The master is structured into a number of portfolios, each of which holds
 * positions in a flexible tree structure.
 */
public interface PositionMaster {

  /**
   * Gets the list of all portfolio identifiers.
   * @return the portfolio identifiers, unmodifiable, not null
   */
  Set<UniqueIdentifier> getPortfolioIds();

  /**
   * Finds a specific portfolio by identifier.
   * @param identifier  the identifier, null returns null
   * @return the portfolio, null if not found
   */
  Portfolio getPortfolio(UniqueIdentifier identifier);

  /**
   * Finds a specific node from any portfolio by identifier.
   * @param identifier  the identifier, null returns null
   * @return the node, null if not found
   */
  PortfolioNode getPortfolioNode(UniqueIdentifier identifier);

  /**
   * Finds a specific position from any portfolio by identifier.
   * @param identifier  the identifier, null returns null
   * @return the position, null if not found
   */
  Position getPosition(UniqueIdentifier identifier);

}

@@ -661,38 +661,38 @@
    * @param 
+u
 id
-entifier  th
+  the uniqu
 e identifier
@@ -749,32 +749,121 @@
 ll if not found%0A
+   * @throws IllegalArgumentException if the identifier is not from this position master%0A
    */%0A  Portfoli
@@ -890,34 +890,27 @@
 eIdentifier 
+u
 id
-entifier
 );%0A%0A  /**%0A  
@@ -976,38 +976,38 @@
    * @param 
+u
 id
-entifier  th
+  the uniqu
 e identifier
@@ -1059,32 +1059,121 @@
 ll if not found%0A
+   * @throws IllegalArgumentException if the identifier is not from this position master%0A
    */%0A  Portfoli
@@ -1208,34 +1208,27 @@
 eIdentifier 
+u
 id
-entifier
 );%0A%0A  /**%0A  
@@ -1306,22 +1306,22 @@
 ram 
+u
 id
-entifier  th
+  the uniqu
 e id
@@ -1389,24 +1389,113 @@
 f not found%0A
+   * @throws IllegalArgumentException if the identifier is not from this position master%0A
    */%0A  Posi
@@ -1528,24 +1528,17 @@
 ntifier 
+u
 id
-entifier
 );%0A%0A%7D%0A

Rewrite position master database