Package com.opengamma.id

Examples of com.opengamma.id.VersionCorrection


  public ManageableHistoricalTimeSeries getTimeSeries(UniqueId uniqueId, HistoricalTimeSeriesGetFilter filter) {
    ArgumentChecker.notNull(uniqueId, "uniqueId");
    checkScheme(uniqueId);

    final VersionCorrection vc;
    if (uniqueId.isVersioned() && uniqueId.getValue().startsWith(DATA_POINT_PREFIX)) {
      vc = extractTimeSeriesInstants(uniqueId);
    } else {
      vc = VersionCorrection.LATEST;
    }
View Full Code Here


    assertTrue(changeManger.hasListener());
    assertTrue(vpm.isRunning());
    assertTrue(vp.isRunning());
    Long initialId = vp.getFunctionCompilationService().getFunctionCompilationContext().getFunctionInitId();
    assertNotNull(initialId);
    VersionCorrection initialVersion = source.getVersionCorrection();
    // Notify it of a change to the master
    Thread.sleep(10);
    changeManger.notifyListenerUnwatchedIdentifier();
    assertNull(vp.isSuspended(Timeout.standardTimeoutMillis()));
    changeManger.notifyListenerWatchedIdentifier();
    assertEquals(Boolean.TRUE, vp.isSuspended(Timeout.standardTimeoutMillis()));
    VersionCorrection newVersion = source.getVersionCorrection();
    assertTrue(newVersion.getVersionAsOf().isAfter(initialVersion.getVersionAsOf()));
    Long newId = 0L;
    for (int i = 0; i < 10; i++) {
      Thread.sleep(Timeout.standardTimeoutMillis() / 10);
      newId = vp.getFunctionCompilationService().getFunctionCompilationContext().getFunctionInitId();
    }
View Full Code Here

    ArgumentChecker.notNull(aggregators, "aggregators");
    ArgumentChecker.notEmpty(marketDataProviders, "marketDataProviders");
    ArgumentChecker.notEmpty(clientId, "clientId");
    boolean blotterColumns = blotter == null ? false : blotter;
    List<MarketDataSpecification> marketDataSpecs = MarketDataSpecificationJsonReader.buildSpecifications(marketDataProviders);
    VersionCorrection versionCorrection = VersionCorrection.of(parseInstant(portfolioVersionTime),
                                                               parseInstant(portfolioCorrectionTime));
    ViewRequest viewRequest = new ViewRequest(UniqueId.parse(viewDefinitionId), aggregators, marketDataSpecs,
                                              parseInstant(valuationTime), versionCorrection, blotterColumns);
    String viewId = Long.toString(s_nextViewId.getAndIncrement());
    URI portfolioGridUri = uriInfo.getAbsolutePathBuilder()
View Full Code Here

    ArgumentChecker.notEmpty(marketDataProviders, "marketDataProviders");
    ArgumentChecker.notEmpty(clientId, "clientId");
    boolean blotterColumns = blotter == null ? false : blotter;
    List<MarketDataSpecification> marketDataSpecs =
        MarketDataSpecificationJsonReader.buildSpecifications(marketDataProviders);
    VersionCorrection versionCorrection = VersionCorrection.of(parseInstant(portfolioVersionTime),
                                                               parseInstant(portfolioCorrectionTime));
    ViewRequest viewRequest = new ViewRequest(UniqueId.parse(viewDefinitionId), aggregators, marketDataSpecs,
                                              parseInstant(valuationTime), versionCorrection, blotterColumns);
    String viewId = Long.toString(s_nextViewId.getAndIncrement());
    URI portfolioGridUri = uriInfo.getAbsolutePathBuilder()
View Full Code Here

  /**
   * @return The changed version of the object, looked up from the master that produced the event.
   */
  /* package */ UniqueIdentifiable getEntity() {
    VersionCorrection versionCorrection = VersionCorrection.of(_event.getVersionFrom(), _event.getVersionInstant());
    return _master.get(_event.getObjectId(), versionCorrection).getValue();
  }
View Full Code Here

      String marketDataType = (String) data.get("marketDataType");
      String versionDateTime = (String) data.get("versionDateTime");

      MarketDataSpecification marketDataSpec;
      EnumSet<ViewExecutionFlags> flags;
      VersionCorrection versionCorrection;
      if (versionDateTime != null) {
        Instant versionAsOf = Instant.parse(versionDateTime);
        versionCorrection = VersionCorrection.ofVersionAsOf(versionAsOf);
      } else {
        versionCorrection = VersionCorrection.LATEST;
View Full Code Here

    }

    HistoricalTimeSeriesInfoSearchResult result = new HistoricalTimeSeriesInfoSearchResult(documents);
    result.setPaging(Paging.of(request.getPagingRequest(), pair.getFirst()));

    final VersionCorrection vc = request.getVersionCorrection().withLatestFixed(Instant.now());
    result.setVersionCorrection(vc);

    // Debug: check result against underlying
    if (EHCachingSearchCache.TEST_AGAINST_UNDERLYING) {
      HistoricalTimeSeriesInfoSearchResult check = ((HistoricalTimeSeriesMaster) getUnderlying()).search(request);
View Full Code Here

    }

    SecuritySearchResult result = new SecuritySearchResult(documents);
    result.setPaging(Paging.of(request.getPagingRequest(), pair.getFirst()));

    final VersionCorrection vc = request.getVersionCorrection().withLatestFixed(Instant.now());
    result.setVersionCorrection(vc);

    // Debug: check result against underlying
    if (EHCachingSearchCache.TEST_AGAINST_UNDERLYING) {
      SecuritySearchResult check = ((SecurityMaster) getUnderlying()).search(request);
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @GET
  public Response get(@Context UriInfo uriInfo, @QueryParam("versionAsOf") String versionAsOf, @QueryParam("correctedTo") String correctedTo) {
    VersionCorrection vc = VersionCorrection.parse(versionAsOf, correctedTo);
    HistoricalTimeSeriesGetFilter filter = RestUtils.decodeQueryParams(uriInfo, HistoricalTimeSeriesGetFilter.class);
    if (filter != null) {
      ManageableHistoricalTimeSeries result = getHistoricalTimeSeriesMaster().getTimeSeries(getUrlDataPointsId(), vc, filter);
      return responseOkFudge(result);
    } else {
View Full Code Here

    }
  }

  private HistoricalTimeSeries doGetHistoricalTimeSeries(UniqueId uniqueId, LocalDate start, LocalDate end, Integer maxPoints) {
    ArgumentChecker.notNull(uniqueId, "uniqueId");
    final VersionCorrection vc = getVersionCorrection()// lock against change
    try {
      if (vc != null) {
        return getMaster().getTimeSeries(uniqueId, vc, HistoricalTimeSeriesGetFilter.ofRange(start, end, maxPoints));
      } else {
        return getMaster().getTimeSeries(uniqueId, HistoricalTimeSeriesGetFilter.ofRange(start, end, maxPoints));
View Full Code Here

TOP

Related Classes of com.opengamma.id.VersionCorrection

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.