Examples of MasterTimeSeriesWriter


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

  }
 
  private TimeSeriesWriter constructTimeSeriesWriter(boolean write) {
    if (write) {     
      // Create a portfolio writer to persist imported positions, trades and securities to the OG masters
      return new MasterTimeSeriesWriter(_htsMaster);
    } else {
      // Create a dummy portfolio writer to pretty-print instead of persisting
      return new DummyTimeSeriesWriter();        
    }
  }
View Full Code Here

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

    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

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

    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

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

    // 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
Copyright © 2018 www.massapi.com. 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.