Class CommitAttempt

java.lang.Object
io.fluxzero.sdk.modeling.CommitAttempt

public final class CommitAttempt extends Object
Internal state of one model commit attempt, from its loaded begin-state through ordered changes and completion. Instances used only as a handler read context leave the evaluation and completion portions empty.
  • Method Details

    • withDeferredBoundary

      public CommitAttempt withDeferredBoundary(LongSupplier verification)
      Internal single-document loading provenance; copies share the same one-time verification.
    • ensureReadBoundary

      public void ensureReadBoundary()
      Establishes the namespace snapshot before exposing any additional transactional dependency.
    • requireNoAtomicCallback

      public static void requireNoAtomicCallback(ModelRepository repository)
      Internal guard before a public asynchronous mutation leaves its originating thread.
    • currentReadContext

      public static CommitAttempt currentReadContext(ModelRepository repository)
      Returns this repository's active mutation read context, never an event-replay or escaped async context.
    • withReplayReads

      public CommitAttempt withReplayReads(ModelRepository repository, ModelReadBoundary boundary)
      Binds replay reads to their original input without joining live mutation/conflict tracking.
    • currentReplayContext

      public static CommitAttempt currentReplayContext(ModelRepository repository)
      Returns this repository's active replay input; never borrows another application's or namespace's context.
    • graphReadBoundary

      public ModelReadBoundary graphReadBoundary()
      Input boundary for lazy Graph values and relationships, including earlier stored commit substeps.
    • readsDurableStateOnly

      public boolean readsDurableStateOnly()
      Whether this independent operation excludes uncommitted message-batch overlays.
    • trackGraph

      public <T> Graph<T> trackGraph(Graph<T> graph, ModelRepository repository)
      Attaches the same attempt provenance to a repository-created Graph without changing its snapshot.
    • identityReads

      public List<ModelAliasObservation> identityReads()
      Alias mapping observations retained independently of assertion-only dependencies.
    • withAncestorReads

      public CommitAttempt withAncestorReads(ModelAncestorResolver.AncestorReads reads)
      Retains identity-only proof used to resolve indirect injected Models at this context's pinned boundary.
    • ancestorReads

      public ModelAncestorResolver.AncestorReads ancestorReads()
      Returns the proof accompanying this context's ancestor selection, or null for direct targets.
    • withAliasResolutions

      public CommitAttempt withAliasResolutions(Map<String,String> aliases)
      Retains the lookup names that resolved injected read-only targets, including unresolved aliases.
    • aliasResolutions

      public Map<String,String> aliasResolutions()
      Internal loading provenance, separate from the canonically keyed loaded Models.
    • deadlineOrigin

      public Entity<?> deadlineOrigin(String modelId)
      Original loaded revision retained before deadline evaluation stages changes for this attempt.
    • readRelationships

      public List<ModelRelationshipRead> readRelationships(ModelConflictPolicy policy)
      Returns the relationship dependencies relevant to the policy; ACCEPT excludes assertion-only reads.
    • readAliasIds

      public List<String> readAliasIds(ModelConflictPolicy policy)
      Returns consumed alias lookups, excluding assertion-only lookups for ACCEPT.
    • deadlineUpdates

      public List<ModelDeadlineUpdate> deadlineUpdates()
    • managesDeadlines

      public boolean managesDeadlines()
    • create

      public static CommitAttempt create(long readStateIndex, MutationPlan.Resolution resolution, Map<String, ? extends Entity<?>> loadedModels)
      Creates a loaded begin-state for one resolved target set.
    • createSingle

      public static CommitAttempt createSingle(long readStateIndex, String modelId, Class<?> modelType, MutationPlan.Access access, List<String> sourceProperties, Entity<?> entity)
      Creates the allocation-minimal begin-state used by a direct single-model strategy.
    • readStateIndex

      public long readStateIndex()
      Returns the attempt's read state index, using the deferred boundary when one is attached.
    • modelIds

      public List<String> modelIds()
      Returns an immutable list of resolved Model identifiers in resolution order.
    • targets

      public List<MutationPlan.ResolvedModel> targets()
      Returns the Models resolved as targets for this attempt.
    • target

      public MutationPlan.ResolvedModel target(String modelId)
      Returns the resolved target with the supplied Model identifier, or null if absent.
    • entity

      public Entity<?> entity(String modelId)
      Returns the loaded entity for the Model identifier, or null if absent, and records the identifier when read collection is active.
    • entities

      public Map<String, Entity<?>> entities()
      Returns the loaded entity map and records all its identifiers when read collection is active.
    • graphEntities

      public Map<String, Entity<?>> graphEntities()
      Loaded and staged values visible to Graph reads at this attempt's boundary.
    • attachTo

      public DeserializingMessage attachTo(DeserializingMessage message)
      Attaches this attempt to the non-null message's context and returns that message.
    • readModelIds

      public List<String> readModelIds()
      Returns the Model identifiers retained as read dependencies for this attempt.
    • readModelIds

      public List<String> readModelIds(ModelConflictPolicy policy)
      Reads needed to preserve this policy's evaluation: ACCEPT only reapplies its original steps.
    • steps

      public List<CommitAttempt.Step> steps()
      Returns the ordered message/change steps retained by this attempt.
    • transitions

      public List<Change> transitions()
      Returns the Model changes retained by this attempt.
    • cascadeRootIds

      public Set<String> cascadeRootIds()
      Returns the Model identifiers that initiate cascaded deletion in this attempt.