Package com.opengamma.integration.copier.timeseries.writer

Examples of com.opengamma.integration.copier.timeseries.writer.TimeSeriesWriter


                                                                               dataField,
                                                                               observationTime,
                                                                               idScheme,
                                                                               dateFormat);

      timeSeriesReader.writeTo(new TimeSeriesWriter() {
        @Override
        public LocalDateDoubleTimeSeries writeDataPoints(ExternalId htsId,
                                                         String dataSource,
                                                         String dataProvider,
                                                         String dataField,
View Full Code Here


                  String idScheme,
                  String dateFormat,
                  boolean persist) {

    // Set up writer
    TimeSeriesWriter timeSeriesWriter = constructTimeSeriesWriter(persist);
   
     // Set up reader
    TimeSeriesReader timeSeriesReader = new SingleSheetMultiTimeSeriesReader(sheetFormat,
                                                                             portfolioFileStream,
                                                                             dataSource,
                                                                             dataProvider,
                                                                             dataField,
                                                                             observationTime,
                                                                             idScheme,
                                                                             dateFormat);
   
    // Load in and write the securities, positions and trades
    timeSeriesReader.writeTo(timeSeriesWriter);
   
    // Flush changes to portfolio master
    timeSeriesWriter.flush();
   
  }
View Full Code Here

    SheetReader mockSheetReader = buildMockSheetReader(lddts);
    TimeSeriesReader reader = new SingleSheetMultiTimeSeriesReader(
            mockSheetReader, DATA_SOURCE, DATA_PROVIDER, DATA_FIELD, OBSERVATION_TIME, ID_SCHEME, DATE_FORMAT);
   
    // Write
    TimeSeriesWriter mockTimeSeriesWriter = mock(TimeSeriesWriter.class);
   
    reader.writeTo(mockTimeSeriesWriter);
   
    // check sheet reader calls and ts writer calls
    verify(mockTimeSeriesWriter, times(1)).writeDataPoints(
View Full Code Here

    double[] newValues = {1.5, 2.5};
    LocalDateDoubleTimeSeries newDataPoints = ImmutableLocalDateDoubleTimeSeries.of(newDates, newValues);
    HistoricalTimeSeriesMaster htsMaster = buildHistoricalTimeSeriesMaster(existingDataPoints);

    // Write the new data points to an existing hts
    TimeSeriesWriter writer = new MasterTimeSeriesWriter(htsMaster);
    writer.writeDataPoints(EXISTING_HTSINFO_EXTERNALID, DATA_SOURCE, DATA_PROVIDER, DATA_FIELD, OBSERVATION_TIME,
        newDataPoints);
   
    // Retrieve the hts contents from the master
    HistoricalTimeSeriesInfoSearchRequest request = new HistoricalTimeSeriesInfoSearchRequest();
    request.setExternalIdSearch(new ExternalIdSearch(EXISTING_HTSINFO_EXTERNALID));
View Full Code Here

    LocalDate[] dates = {LocalDate.of(2010,1,1), LocalDate.of(2011,1,1)};
    double[] values = {1.0, 2.0};
    LocalDateDoubleTimeSeries dataPoints = ImmutableLocalDateDoubleTimeSeries.of(dates, values);
    HistoricalTimeSeriesMaster htsMaster = buildHistoricalTimeSeriesMaster(dataPoints);
    // Write the new data points to an existing hts
    TimeSeriesWriter writer = new MasterTimeSeriesWriter(htsMaster);
    writer.writeDataPoints(NEW_HTSINFO_EXTERNALID, DATA_SOURCE, DATA_PROVIDER, DATA_FIELD, OBSERVATION_TIME,
        dataPoints);
   
    // Retrieve and check the hts master contents
    HistoricalTimeSeriesInfoSearchRequest request = new HistoricalTimeSeriesInfoSearchRequest();
    request.setExternalIdSearch(new ExternalIdSearch(NEW_HTSINFO_EXTERNALID));
View Full Code Here

    // Set up the reader to read from file and the writer to write to the in-memory master, and do the import
    InputStream fileStream = new BufferedInputStream(new FileInputStream(FILENAME));
    TimeSeriesReader reader = new SingleSheetMultiTimeSeriesReader(
        SheetFormat.of(FILENAME), fileStream, DATA_SOURCE, DATA_PROVIDER, DATA_FIELD, OBSERVATION_TIME, ID_SCHEME, DATE_FORMAT);
    HistoricalTimeSeriesMaster htsMaster = buildHistoricalTimeSeriesMaster(existingDataPoints);
    TimeSeriesWriter writer = new MasterTimeSeriesWriter(htsMaster);
    reader.writeTo(writer);
   
    // Retrieve hts master contents
    HistoricalTimeSeriesInfoSearchRequest request = new HistoricalTimeSeriesInfoSearchRequest();
    request.setExternalIdSearch(new ExternalIdSearch(ExternalId.of(ID_SCHEME, readId)));
View Full Code Here

TOP

Related Classes of com.opengamma.integration.copier.timeseries.writer.TimeSeriesWriter

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.