Class CommitModelsResult

java.lang.Object
io.fluxzero.common.api.AbstractRequestResult
io.fluxzero.common.api.modeling.CommitModelsResult
All Implemented Interfaces:
JsonType, RequestResult

public class CommitModelsResult extends AbstractRequestResult
Result of an accepted, rebase-requested, or conflict-rejected CommitModels.

Accepted results are durable and include completion of direct document and snapshot materialization. A duplicate accepted commitId returns the same logical result with the new request ID used for response correlation. Rebase and conflict results are not retained under the idempotency key.

  • Constructor Details

    • CommitModelsResult

      @ConstructorProperties({"requestId","commitId","updates","conflicts","retryAllowed","duplicate","rebaseStateIndex"}) public CommitModelsResult(long requestId, String commitId, List<ModelUpdate> updates, List<ModelCommitConflict> conflicts, boolean retryAllowed, boolean duplicate, Long rebaseStateIndex)
      Creates a model commit result, normalizing omitted compatibility fields to empty collections.
  • Method Details

    • accepted

      public static CommitModelsResult accepted(long requestId, String commitId, List<ModelUpdate> updates)
      Creates an accepted commit result.
    • acceptedSingleTarget

      public static CommitModelsResult acceptedSingleTarget(long requestId, String commitId, long stateIndex, Long eventIndex, String modelId, long sequenceNumber, boolean historyComplete)
      Creates the common one-substep, one-target accepted result.
    • conflict

      public static CommitModelsResult conflict(long requestId, String commitId, List<ModelCommitConflict> conflicts, boolean retryAllowed)
      Creates a rejected conflict result. Rejected results are not retained under the commit idempotency key.
    • isAccepted

      public boolean isAccepted()
      Returns whether the runtime committed the commit.
    • isRebaseRequired

      public boolean isRebaseRequired()
      Returns whether the runtime requests an internal apply-only rebase without rejecting the original event.
    • forRequest

      public CommitModelsResult forRequest(long requestId)
      Copies this logical result with another transport request ID.
    • asDuplicateForRequest

      public CommitModelsResult asDuplicateForRequest(long requestId)
      Copies this accepted result for an idempotent duplicate request.
    • hasSingleTargetResult

      public boolean hasSingleTargetResult()
      Returns whether this result contains exactly one committed target position.
    • rebase

      public static CommitModelsResult rebase(long requestId, String commitId, List<ModelCommitConflict> changedModels, long rebaseStateIndex)
      Requests an internal apply-only rebase at the supplied current boundary.
    • toMetric

      public CommitModelsResult.Metric toMetric()
      Returns a target-ID-free metric representation.
      Returns:
      a safe and compact object suitable for serialization to the metrics log