/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 * 
 * Please see distribution for license.
 */

package com.opengamma.integration.loadsave.portfolio.writer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opengamma.integration.loadsave.portfolio.PortfolioLoader;
import com.opengamma.master.portfolio.ManageablePortfolio;
import com.opengamma.master.portfolio.ManageablePortfolioNode;
import com.opengamma.master.position.ManageablePosition;
import com.opengamma.master.security.ManageableSecurity;

/**
 * A dummy portfolio writer, which pretty-prints information instead of persisting
 * TODO implement portfolio tree methods
 */
public class DummyPortfolioWriter implements PortfolioWriter {

  private static final Logger s_logger = LoggerFactory.getLogger(PortfolioLoader.class);

  private ManageablePortfolioNode _node = new ManageablePortfolioNode();
  
  @Override
  public ManageableSecurity writeSecurity(ManageableSecurity security) {
    s_logger.info("Security: " + security.toString());
    return security;
  }

  @Override
  public ManageablePosition writePosition(ManageablePosition position) {
    s_logger.info("Position: " + position.toString());
    return position;
  }

  @Override
  public ManageablePortfolio getPortfolio() {
    return null;
  }

  @Override
  public ManageablePortfolioNode getCurrentNode() {
    return _node;
  }

  @Override
  public ManageablePortfolioNode setCurrentNode(ManageablePortfolioNode node) {
    s_logger.info("Set node to: " + node.toString());
    _node = node;
    return _node;
  }

  @Override
  public void flush() {
    s_logger.info("Flushed writer");
  }

  @Override
  public void close() {
    s_logger.info("Closed writer");
  }
  
}

@@ -1006,37 +1006,42 @@
 rity) %7B%0A    
-s_logger.info
+System.out.println
 (%22Security: 
@@ -1181,29 +1181,34 @@
 ) %7B%0A    
-s_logger.info
+System.out.println
 (%22Positi
@@ -1526,29 +1526,34 @@
 ) %7B%0A    
-s_logger.info
+System.out.println
 (%22Set no
@@ -1662,29 +1662,34 @@
 ) %7B%0A    
-s_logger.info
+System.out.println
 (%22Flushe
@@ -1749,21 +1749,26 @@
     
-s_logger.info
+System.out.println
 (%22Cl

Change dummy portfolio writer to print to stdout instead of logging output