Class CommitModelsResult
java.lang.Object
io.fluxzero.common.api.AbstractRequestResult
io.fluxzero.common.api.modeling.CommitModelsResult
- All Implemented Interfaces:
JsonType, RequestResult
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPayload-free commit-result metrics. -
Constructor Summary
ConstructorsConstructorDescriptionCommitModelsResult(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 Summary
Modifier and TypeMethodDescriptionstatic CommitModelsResultaccepted(long requestId, String commitId, List<ModelUpdate> updates) Creates an accepted commit result.static CommitModelsResultacceptedSingleTarget(long requestId, String commitId, long stateIndex, Long eventIndex, String modelId, long sequenceNumber, boolean historyComplete) Creates the common one-substep, one-target accepted result.asDuplicateForRequest(long requestId) Copies this accepted result for an idempotent duplicate request.static CommitModelsResultconflict(long requestId, String commitId, List<ModelCommitConflict> conflicts, boolean retryAllowed) Creates a rejected conflict result.forRequest(long requestId) Copies this logical result with another transport request ID.booleanReturns whether this result contains exactly one committed target position.booleanReturns whether the runtime committed the commit.booleanReturns whether the runtime requests an internal apply-only rebase without rejecting the original event.static CommitModelsResultrebase(long requestId, String commitId, List<ModelCommitConflict> changedModels, long rebaseStateIndex) Requests an internal apply-only rebase at the supplied current boundary.toMetric()Returns a target-ID-free metric representation.Methods inherited from class AbstractRequestResult
getRequestReceivedTimestamp, getResponseQueuedTimestamp, getResponseSendStartTimestamp, setRequestReceivedTimestamp, setResponseQueuedTimestamp, setResponseSendStartTimestampMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RequestResult
getRequestId, getTimestamp
-
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
Copies this logical result with another transport request ID. -
asDuplicateForRequest
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
Returns a target-ID-free metric representation.- Returns:
- a safe and compact object suitable for serialization to the metrics log
-