Class ModelRelationshipQueries
java.lang.Object
io.fluxzero.common.modeling.ModelRelationshipQueries
Shared graph, ancestor, lineage and relationship-query policies for every Model store.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceStorage-independent view of one temporal child-to-parent relationship interval.static final recordState selected for a read and whether it came from the requested selector rather than an allowed fallback. -
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends ModelRelationshipQueries.Relationship>
ModelRelationshipTraversal.ResultcurrentGraph(Collection<String> rootModelIds, int maxDepth, int maxModels, Function<Collection<String>, List<R>> relationships) Resolves the current composable descendant graph for a root page.static StringdeletionFingerprint(String rootId, ModelDeletionCascade cascade, List<String> orderedIds) Stable fingerprint for one ordered hard-deletion selection.static <R extends ModelRelationshipQueries.Relationship>
Set<String> descendantLineage(Collection<String> roots, long boundary, int maxDepth, int maxModels, Function<Collection<String>, List<R>> currentRelationships, Function<Collection<String>, List<R>> deletedRelationships, Function<Collection<String>, Collection<String>> protectedDescendants) Resolves current and lifecycle-retained descendants at one boundary.static <R extends ModelRelationshipQueries.Relationship>
Set<String> descendantLineage(Collection<String> roots, long boundary, int maxDepth, int maxModels, Function<Collection<String>, List<R>> currentRelationships, Function<Collection<String>, List<R>> deletedRelationships, Function<Collection<String>, Collection<String>> protectedDescendants, String maxModelsExceeded, String maxDepthExceeded) Resolves descendants with caller-specific bound failures.descendants(Collection<String> roots, ModelRelationshipTraversal.RelationshipLoader<String> children) Traverses an already selected child index without recreating frontier and visit semantics.static <R extends ModelRelationshipQueries.Relationship>
GetModelGraphResultgraph(GetModelGraph request, long boundary, boolean exactBoundary, Function<Collection<String>, List<R>> relationships, Function<GetModelEvents, GetModelEventsResult> events) Resolves a graph while retaining evidence about the original selector that established its boundary.static <R extends ModelRelationshipQueries.Relationship>
GetModelGraphResultgraph(GetModelGraph request, long boundary, Function<Collection<String>, List<R>> relationships, Function<GetModelEvents, GetModelEventsResult> events) Resolves one bounded relationship graph and its first stream page.static <R extends ModelRelationshipQueries.Relationship>
Set<String> graphAncestors(Collection<String> modelIds, int maxDepth, Function<Collection<String>, List<R>> relationships) Resolves composable ancestors with one shared traversal policy.ownedDescendants(Collection<String> roots, Collection<ModelGraphEdge> edges) Returns descendants whose complete path from a supplied root owns the child lifecycle.static <R extends ModelRelationshipQueries.Relationship>
Set<String> relatedModels(Set<String> relatedModelIds, ModelRelationConstraint constraint, Function<Collection<String>, List<R>> parentRelationships, Function<Collection<String>, List<R>> childRelationships) Resolves models related at the configured depths and paths.static longresolveBoundary(ModelReadBoundary boundary, boolean rejectNewer, LongSupplier currentState, BiFunction<String, Integer, Long> commitBoundary, Function<Long, Long> eventBoundary) Resolves a current, state, commit or event selector against one visible store boundary.resolveBoundaryWithEvidence(ModelReadBoundary boundary, boolean rejectNewer, LongSupplier currentState, BiFunction<String, Integer, Long> commitBoundary, Function<Long, Long> eventBoundary) Resolves a boundary and records whether an event selector used its explicit current-state fallback.
-
Method Details
-
resolveBoundary
public static long resolveBoundary(ModelReadBoundary boundary, boolean rejectNewer, LongSupplier currentState, BiFunction<String, Integer, Long> commitBoundary, Function<Long, Long> eventBoundary) Resolves a current, state, commit or event selector against one visible store boundary. -
resolveBoundaryWithEvidence
public static ModelRelationshipQueries.ResolvedBoundary resolveBoundaryWithEvidence(ModelReadBoundary boundary, boolean rejectNewer, LongSupplier currentState, BiFunction<String, Integer, Long> commitBoundary, Function<Long, Long> eventBoundary) Resolves a boundary and records whether an event selector used its explicit current-state fallback. -
graph
public static <R extends ModelRelationshipQueries.Relationship> GetModelGraphResult graph(GetModelGraph request, long boundary, Function<Collection<String>, List<R>> relationships, Function<GetModelEvents, GetModelEventsResult> events) Resolves one bounded relationship graph and its first stream page. -
graph
public static <R extends ModelRelationshipQueries.Relationship> GetModelGraphResult graph(GetModelGraph request, long boundary, boolean exactBoundary, Function<Collection<String>, List<R>> relationships, Function<GetModelEvents, GetModelEventsResult> events) Resolves a graph while retaining evidence about the original selector that established its boundary. -
currentGraph
public static <R extends ModelRelationshipQueries.Relationship> ModelRelationshipTraversal.Result currentGraph(Collection<String> rootModelIds, int maxDepth, int maxModels, Function<Collection<String>, List<R>> relationships) Resolves the current composable descendant graph for a root page. -
descendantLineage
public static <R extends ModelRelationshipQueries.Relationship> Set<String> descendantLineage(Collection<String> roots, long boundary, int maxDepth, int maxModels, Function<Collection<String>, List<R>> currentRelationships, Function<Collection<String>, List<R>> deletedRelationships, Function<Collection<String>, Collection<String>> protectedDescendants) Resolves current and lifecycle-retained descendants at one boundary. -
descendantLineage
public static <R extends ModelRelationshipQueries.Relationship> Set<String> descendantLineage(Collection<String> roots, long boundary, int maxDepth, int maxModels, Function<Collection<String>, List<R>> currentRelationships, Function<Collection<String>, List<R>> deletedRelationships, Function<Collection<String>, Collection<String>> protectedDescendants, String maxModelsExceeded, String maxDepthExceeded) Resolves descendants with caller-specific bound failures. -
graphAncestors
public static <R extends ModelRelationshipQueries.Relationship> Set<String> graphAncestors(Collection<String> modelIds, int maxDepth, Function<Collection<String>, List<R>> relationships) Resolves composable ancestors with one shared traversal policy. -
ownedDescendants
public static List<String> ownedDescendants(Collection<String> roots, Collection<ModelGraphEdge> edges) Returns descendants whose complete path from a supplied root owns the child lifecycle. -
descendants
public static List<String> descendants(Collection<String> roots, ModelRelationshipTraversal.RelationshipLoader<String> children) Traverses an already selected child index without recreating frontier and visit semantics. -
deletionFingerprint
public static String deletionFingerprint(String rootId, ModelDeletionCascade cascade, List<String> orderedIds) Stable fingerprint for one ordered hard-deletion selection.
-