Package com.opengamma.integration.copier.portfolio

Examples of com.opengamma.integration.copier.portfolio.ResolvingPortfolioCopier


        getCommandLine().getOptionValue(FILE_NAME_OPT),
        context.getSecurityProvider()
    );
   
    // Create portfolio copier
    ResolvingPortfolioCopier portfolioCopier = new ResolvingPortfolioCopier(
        context.getHistoricalTimeSeriesMaster(),
        context.getHistoricalTimeSeriesProvider(),
        context.getBloombergReferenceDataProvider(),
        getOptionValue(TIME_SERIES_DATAPROVIDER_OPT, "CMPL"),
        getCommandLine().getOptionValues(TIME_SERIES_DATAFIELD_OPT) == null ?
            new String[]{"PX_LAST"} : getCommandLine().getOptionValues(TIME_SERIES_DATAFIELD_OPT)
    );
   
    // Create visitor for verbose/quiet mode
    PortfolioCopierVisitor portfolioCopierVisitor;
    if (getCommandLine().hasOption(VERBOSE_OPT)) {
      portfolioCopierVisitor = new VerbosePortfolioCopierVisitor();
    } else {
      portfolioCopierVisitor = new QuietPortfolioCopierVisitor();
    }
   
    // Call the portfolio loader with the supplied arguments
    portfolioCopier.copy(portfolioReader, portfolioWriter, portfolioCopierVisitor);
   
    // close stuff
    portfolioReader.close();
    portfolioWriter.close();
  }
View Full Code Here


                    new Object[]{fileName, portfolioName, dataField, dataProvider});

      if (!(fileEntity instanceof BodyPartEntity)) {
        throw new WebApplicationException(Response.Status.BAD_REQUEST);
      }
      final ResolvingPortfolioCopier copier = new ResolvingPortfolioCopier(_historicalTimeSeriesMaster,
                                                                           _historicalTimeSeriesProvider,
                                                                           _referenceDataProvider,
                                                                           dataProvider,
                                                                           dataFields);
      final PortfolioWriter portfolioWriter =
          new MasterPortfolioWriter(portfolioName, _portfolioMaster, _positionMaster, _securityMaster, false, false, true);
      SheetFormat format = getFormatForFileName(fileName);
      RowParser rowParser = new ExchangeTradedRowParser(_securityProvider);
      final PortfolioReader portfolioReader = new SingleSheetSimplePortfolioReader(format, fileStream, rowParser);
      StreamingOutput streamingOutput = new StreamingOutput() {
        @Override
        public void write(OutputStream output) throws IOException, WebApplicationException {
          // TODO callback for progress updates as portoflio is copied
          copier.copy(portfolioReader, portfolioWriter);
          output.write("Upload complete".getBytes());
        }
      };
      return Response.ok(streamingOutput).build();
    }
View Full Code Here

        context.getPortfolioMaster(),
        context.getPositionMaster(),
        context.getSecuritySource());
   
    // Create portfolio copier
    ResolvingPortfolioCopier portfolioCopier = new ResolvingPortfolioCopier(
        context.getHistoricalTimeSeriesMaster(),
        context.getHistoricalTimeSeriesProvider(),
        context.getBloombergReferenceDataProvider(),
        getOptionValue(TIME_SERIES_DATAPROVIDER_OPT, "CMPL"),
        getCommandLine().getOptionValues(TIME_SERIES_DATAFIELD_OPT) == null ?
            new String[]{"PX_LAST"} : getCommandLine().getOptionValues(TIME_SERIES_DATAFIELD_OPT)
    );
   
    // Create visitor for verbose/quiet mode
    PortfolioCopierVisitor portfolioCopierVisitor;
    if (getCommandLine().hasOption(VERBOSE_OPT)) {
      portfolioCopierVisitor = new VerbosePortfolioCopierVisitor();
    } else {
      portfolioCopierVisitor = new QuietPortfolioCopierVisitor();
    }
   
    // Call the portfolio loader with the supplied arguments
    portfolioCopier.copy(portfolioReader, portfolioWriter, portfolioCopierVisitor);
   
    // close stuff
    portfolioReader.close();
    portfolioWriter.close();
  }
View Full Code Here

TOP

Related Classes of com.opengamma.integration.copier.portfolio.ResolvingPortfolioCopier

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.