Interface TotpStore
- All Known Implementing Classes:
InMemoryTotpStore
InMemoryTotpStore is an explicitly selected
volatile demonstration backend, never an automatic fallback.
Both record kinds are permanent. No backend TTL, eviction or automatic deletion is allowed, including after factor removal. Capacity refusal changes nothing. Unknown acknowledgement after a possible mutation is UNKNOWN, never CONFLICT or UNAVAILABLE. Only definite CONFLICT permits bounded recalculation. Honor positive remaining caller-thread budgets and preserve interruption.
Namespace activation metadata is application-owned. INITIALIZE_NAMESPACE atomically inserts its root and changes NEW to ACTIVATED once. Updates require ACTIVATED and a present root; a missing root in an activated epoch is unavailability, never permission to initialize again. Recovery provisioning fences all old writers before a fresh, never-reused epoch is initialized.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncompareAndCommit(@NonNull TotpStoreWrite write, @NonNull Duration remainingBudget) Atomically compares current admission, epoch and all snapshot predicates, then validates fresh store-authoritative time after every wait, including for condition-only writes.Reads exactly the requested nonempty bounded scope at one authoritative snapshot point, checking the active epoch and operational admission in the same transaction.
-
Method Details
-
read
@NonNull TotpStoreReadResult read(@NonNull Set<@NonNull TotpStoreKey> keys, @NonNull Duration remainingBudget) Reads exactly the requested nonempty bounded scope at one authoritative snapshot point, checking the active epoch and operational admission in the same transaction. The entries and fresh admitted time or time-only unavailability form one coherent observation. Explicitly represent every absence; no cleanup, quota update or floor write belongs to a read.- Parameters:
keys- one namespace and recovery epoch, at most 16 addressesremainingBudget- remaining positive operation budget- Returns:
- a complete snapshot, fenced epoch or unavailable read
- Since:
- 1.0.0
-
compareAndCommit
@NonNull TotpStoreCommitReceipt compareAndCommit(@NonNull TotpStoreWrite write, @NonNull Duration remainingBudget) Atomically compares current admission, epoch and all snapshot predicates, then validates fresh store-authoritative time after every wait, including for condition-only writes.- Parameters:
write- the exact predicates and complete change setremainingBudget- remaining positive operation budget- Returns:
- the factual contextual receipt, with required validation timing for COMMITTED
- Since:
- 1.0.0
-