Class PendingChanges
java.lang.Object
com.ultikits.ultitools.utils.PendingChanges
A bounded view of the transaction journal and its single-entry revocation operation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe operation that will take effect at the next start.static final recordOne transaction; a download has a provisional id and no on-disk revision.static final recordThe kind and optional name of the sender that requested a change.static final recordThe result of revoking one entry; before is also available for an unrevocable entry.static final recordA bounded list with the number omitted and the generation observed in the same read.static enumThe states visible while the server is running. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of entries in the list exposed to callers.private final ModuleFileTransactions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindByModule(String name) list()Revokes one transaction by id; the revision check prevents acting on a stale view.revokeByModule(String name) snapshot()
-
Field Details
-
MAX_ITEMS
public static final int MAX_ITEMSMaximum number of entries in the list exposed to callers.- See Also:
-
transactions
-
-
Constructor Details
-
PendingChanges
-
-
Method Details
-
list
- Returns:
- the first
MAX_ITEMSentries, oldest first, then by id
-
snapshot
- Returns:
- the entries, their truncation count and the generation from one locked read
-
findByModule
- Returns:
- the entry matching the identify string, module name or JAR name, or null
-
revokeByModule
- Returns:
- the result of finding and revoking a module in one locked operation
-
revoke
public PendingChanges.RevokeResult revoke(String id, String expectedRevision, boolean checkRevision) Revokes one transaction by id; the revision check prevents acting on a stale view. A null expected revision matches only a download when checking is enabled.- Parameters:
id- the transaction id, as returned bylist()expectedRevision- the revision observed by the caller, or null for a downloadcheckRevision- whether to compare the caller's revision before mutating anything- Returns:
- the result of the attempt
-