Package com.opengamma.id

Examples of com.opengamma.id.VersionCorrection


    return hts;
  }

  private HistoricalTimeSeries doGetHistoricalTimeSeries(ObjectId objectId, LocalDate start, LocalDate end, Integer maxPoints) {
    ArgumentChecker.notNull(objectId, "objectId");
    VersionCorrection vc = getVersionCorrection()// lock against change
    vc = Objects.firstNonNull(vc, VersionCorrection.LATEST);
    try {
      return getMaster().getTimeSeries(objectId, vc, HistoricalTimeSeriesGetFilter.ofRange(start, end, maxPoints));
    } catch (DataNotFoundException ex) {
      return null;
View Full Code Here


    }

    PositionSearchResult result = new PositionSearchResult(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) {
      PositionSearchResult check = ((PositionMaster) getUnderlying()).search(request);
View Full Code Here

  @Override
  public Collection<Security> get(ExternalIdBundle bundle, VersionCorrection versionCorrection) {
    ArgumentChecker.notNull(bundle, "bundle");
    ArgumentChecker.notNull(versionCorrection, "versionCorrection");
    VersionCorrection overrideVersionCorrection = getVersionCorrection();

    Collection<Security> securities = new ArrayList<Security>();
    for (ManageableSecurity manageableSecurity : getSecuritiesInternal(bundle, overrideVersionCorrection != null ? overrideVersionCorrection : versionCorrection)) {
      securities.add(manageableSecurity);
    }
View Full Code Here

  @Override
  public ManageableSecurity getSingle(ExternalIdBundle bundle, VersionCorrection versionCorrection) {
    ArgumentChecker.notNull(bundle, "bundle");
    ArgumentChecker.notNull(versionCorrection, "versionCorrection");
    VersionCorrection overrideVersionCorrection = getVersionCorrection();
    final Collection<ManageableSecurity> securities = getSecuritiesInternal(bundle, overrideVersionCorrection != null ? overrideVersionCorrection : versionCorrection);
    // simply picks the first returned security
    return securities.isEmpty() ? null : securities.iterator().next();
  }
View Full Code Here

      return true;
    }
    if (x == null || y == null) {
      return false;
    }
    VersionCorrection ix = (VersionCorrection) x;
    VersionCorrection iy = (VersionCorrection) y;
    return ix.equals(iy);
  }
View Full Code Here

  }

  @Test
  public void resolutionTime() {
    String rtStr = "V1970-01-01T00:00:01Z.CLATEST";
    VersionCorrection rt = VersionCorrection.parse(rtStr);

    final DependencyGraphTraceBuilderProperties builder1 = createBuilder();
    VersionCorrection defaultVC = builder1.getResolutionTime();
    final DependencyGraphTraceBuilderProperties builder2 = builder1.resolutionTime(rt);

    assertEquals(defaultVC, builder1.getResolutionTime());
    assertEquals(rt, builder2.getResolutionTime());
  }
View Full Code Here

    ArgumentChecker.notNull(extractor, "extractor");
    s_logger.debug("getByOidInstants {}", objectId);

    Timer.Context context = _getByOidInstantsTimer.time();
    try {
      final VersionCorrection vc = (versionCorrection.containsLatest() ? versionCorrection.withLatestFixed(now()) : versionCorrection);
      final DbMapSqlParameterSource args = argsGetByOidInstants(objectId, vc);
      final NamedParameterJdbcOperations namedJdbc = getDbConnector().getJdbcTemplate();
      final String sql = getElSqlBundle().getSql("GetByOidInstants", args);
      final List<D> docs = namedJdbc.query(sql, args, extractor);
      if (docs.isEmpty()) {
View Full Code Here

  @Test
  public void getTraceResolutionTime() {
    DependencyGraphTraceBuilderProperties properties = new DependencyGraphTraceBuilderProperties();

    String rtStr = "V1970-01-01T00:00:01Z.CLATEST";
    VersionCorrection rt = VersionCorrection.parse(rtStr);

    properties = properties.resolutionTime(rt);

    URI uri = _provider.buildUri(properties);
View Full Code Here

    }

    MarketDataSnapshotSearchResult result = new MarketDataSnapshotSearchResult(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) {
      MarketDataSnapshotSearchResult check = ((MarketDataSnapshotMaster) getUnderlying()).search(request);
View Full Code Here

      _fromCorrection = document.getCorrectionFromInstant();
      _toCorrection = document.getCorrectionToInstant();
    }

    public boolean matches(Object o) {
      VersionCorrection vc = (VersionCorrection) o;
      return  (_fromVersion == null || vc.getVersionAsOf() == null || vc.getVersionAsOf().isAfter(_fromVersion)) &&
              (_toVersion == null || vc.getVersionAsOf() != null && vc.getVersionAsOf().isBefore(_toVersion)) &&
              (_fromCorrection == null || vc.getCorrectedTo() == null || vc.getCorrectedTo().isAfter(_fromCorrection)) &&
              (_toCorrection == null || vc.getCorrectedTo() != null && vc.getCorrectedTo().isBefore(_toCorrection));
    }
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.