Package com.opengamma.id

Examples of com.opengamma.id.VersionCorrection


    }
    Instant versionFrom = Objects.firstNonNull(document.getVersionFromInstant(), Instant.MIN);
    Instant versionTo = Objects.firstNonNull(document.getVersionToInstant(), Instant.MAX);
    Instant correctionFrom = Objects.firstNonNull(document.getCorrectionFromInstant(), Instant.MIN);
    Instant correctionTo = Objects.firstNonNull(document.getCorrectionToInstant(), Instant.MAX);
    VersionCorrection locked = getVersionCorrection().withLatestFixed(OpenGammaClock.getInstance().instant());
    Instant versionPoint = locked.getVersionAsOf();
    Instant corrrectionPoint = locked.getCorrectedTo();
    return versionPoint.isBefore(versionTo) &&
        !versionFrom.isAfter(versionPoint) &&
        corrrectionPoint.isBefore(correctionTo) &&
        !correctionFrom.isAfter(corrrectionPoint);
  }
View Full Code Here


  }

  //-------------------------------------------------------------------------
  @GET
  public Response get(@QueryParam("versionAsOf") String versionAsOf, @QueryParam("correctedTo") String correctedTo) {
    VersionCorrection vc = VersionCorrection.parse(versionAsOf, correctedTo);
    ConfigDocument result = getConfigMaster().get(getUrlConfigId(), vc);
    return responseOkFudge(result);
  }
View Full Code Here

    if (_viewConnections.containsKey(viewId)) {
      throw new IllegalArgumentException("View ID " + viewId + " is already in use");
    }
    AggregatedViewDefinition aggregatedViewDef = new AggregatedViewDefinition(_aggregatedViewDefManager, request);
    ViewDefinition viewDef = (ViewDefinition) _configSource.get(aggregatedViewDef.getUniqueId()).getValue();
    VersionCorrection versionCorrection = request.getPortfolioVersionCorrection();
    // this can be null for a primitives-only view
    UniqueId portfolioId = viewDef.getPortfolioId();
    Supplier<Portfolio> portfolioSupplier;
    ObjectId portfolioObjectId;
    if (portfolioId != null) {
View Full Code Here

    verify(m1, times(2)).get(u1);
  }

  @Test
  public void getObjectIdentifiableVersionCorrection() {
    VersionCorrection vc = VersionCorrection.LATEST;
    //test multiple invocations here
    when(m1.get(o1, vc)).thenReturn(d1);
   
    cMaster.get(o1, vc);
    cMaster.get(o1, vc);
View Full Code Here

   * @return the document, not null
   * @throws DataNotFoundException if the document could not be found
   */
  public D getDocument(UniqueId uniqueId) {
    ArgumentChecker.notNull(uniqueId, "uniqueId");
    final VersionCorrection vc = getVersionCorrection(); // lock against change
    if (vc != null) {
      return (D) getMaster().get(uniqueId.getObjectId(), vc);
    } else {
      return (D) getMaster().get(uniqueId);
    }
View Full Code Here

   * @throws DataNotFoundException if the document could not be found
   */
  public D getDocument(ObjectId objectId, VersionCorrection versionCorrection) {
    ArgumentChecker.notNull(objectId, "objectId");
    ArgumentChecker.notNull(versionCorrection, "versionCorrection");
    VersionCorrection overrideVersionCorrection = getVersionCorrection();
    return (D) getMaster().get(objectId, overrideVersionCorrection != null ? overrideVersionCorrection : versionCorrection);
  }
View Full Code Here

  //===================== ROUTING HELPERS ==============================================================================
 
  // @GET
  protected Response get(/*@QueryParam("versionAsOf")*/ String versionAsOf, /*@QueryParam("correctedTo")*/ String correctedTo) {
    VersionCorrection vc = VersionCorrection.parse(versionAsOf, correctedTo);
    D result = getMaster().get(getUrlId(), vc);
    return responseOkFudge(result);
  }
View Full Code Here

  // caller must hold the monitor
  protected void checkForRecompilation(final AbstractViewProcessWorkerContext primary, CompiledViewDefinitionWithGraphs compiled) {
    final ViewCycleExecutionSequence tailSequence = (getSecondary() == null) ? primary.getSequence().copy() : null;
    final ViewCycleExecutionOptions nextCycle = primary.getSequence().poll(getDefaultExecutionOptions());
    if (nextCycle != null) {
      final VersionCorrection vc = nextCycle.getResolverVersionCorrection();
      boolean changes = false;
      if ((vc == null) || VersionCorrection.LATEST.equals(vc)) {
        if (_resolverChanges == null) {
          _resolverChanges = new TargetResolverChangeListener() {
            @Override
View Full Code Here

    final UniqueId viewCycleId = message.getValue(UniqueId.class, FIELD_VIEWCYCLEID);
    final ViewCycleExecutionOptions viewCycleExecutionOptions = deserializer.fieldValueToObject(ViewCycleExecutionOptions.class, message.getByName(FIELD_VIEW_CYCLE_EXECUTION_OPTIONS));
    final Instant calculationTime = message.getFieldValue(Instant.class, message.getByName(FIELD_CALCULATION_TIME));
    FudgeField durationField = message.getByName(FIELD_CALCULATION_DURATION);
    final Duration calculationDuration = durationField != null ? deserializer.fieldValueToObject(Duration.class, durationField) : null;
    final VersionCorrection versionCorrection = deserializer.fieldValueToObject(VersionCorrection.class, message.getByName(FIELD_VERSION_CORRECTION));
    final Map<String, ViewCalculationResultModel> configurationMap = new HashMap<String, ViewCalculationResultModel>();
    final Queue<String> keys = new LinkedList<String>();
    final Queue<ViewCalculationResultModel> values = new LinkedList<ViewCalculationResultModel>();
    for (FudgeField field : message.getFieldValue(FudgeMsg.class, message.getByName(FIELD_RESULTS))) {
      if (field.getOrdinal() == 1) {
View Full Code Here

    return msg;
  }

  @Override
  public CompiledViewDefinition buildObject(FudgeDeserializer deserializer, FudgeMsg message) {
    VersionCorrection versionCorrection = deserializer.fieldValueToObject(VersionCorrection.class, message.getByName(VERSION_CORRECTION_FIELD));
    String compilationId = message.getString(COMPILATION_IDENTIFIER_FIELD);
    ViewDefinition viewDefinition = deserializer.fieldValueToObject(ViewDefinition.class, message.getByName(VIEW_DEFINITION_FIELD));
    FudgeField portfolioField = message.getByName(PORTFOLIO_FIELD);
    Portfolio portfolio = portfolioField != null ? deserializer.fieldValueToObject(Portfolio.class, portfolioField) : null;
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.