Class CaptureSessionStore
java.lang.Object
com.shaft.capture.storage.CaptureSessionStore
Thread-safe start, append, checkpoint, stop, and interruption lifecycle for one capture file.
-
Constructor Summary
ConstructorsConstructorDescriptionCaptureSessionStore(Path path) Creates a store for one capture path.CaptureSessionStore(Path path, CaptureJsonCodec codec) Creates a store with an explicit codec. -
Method Summary
Modifier and TypeMethodDescriptionappend(CaptureEvent event) Appends an event and atomically publishes the updated session.append(CaptureEvent event, List<ExternalTestDataReference> references, RedactionSummary summary) Appends an event with privacy references and summary in one atomic snapshot.checkpoint(Checkpoint checkpoint) Adds a checkpoint and atomically publishes the updated session.checkpoint(Checkpoint checkpoint, RedactionSummary summary) Adds a checkpoint and its sanitized-text summary atomically.markIncomplete(Instant interruptedAt) Explicitly marks an interrupted session while keeping it readable.read()Reads the latest complete file snapshot.voidstart(CaptureSession session) Starts and persists a new incomplete session.Completes and atomically publishes the session.
-
Constructor Details
-
CaptureSessionStore
Creates a store for one capture path.- Parameters:
path- session JSON path
-
CaptureSessionStore
Creates a store with an explicit codec.- Parameters:
path- session JSON pathcodec- capture codec
-
-
Method Details
-
start
Starts and persists a new incomplete session.- Parameters:
session- new incomplete session
-
append
Appends an event and atomically publishes the updated session.- Parameters:
event- event to append- Returns:
- updated session
-
append
public CaptureSession append(CaptureEvent event, List<ExternalTestDataReference> references, RedactionSummary summary) Appends an event with privacy references and summary in one atomic snapshot.- Parameters:
event- event to appendreferences- external references used by the eventsummary- safe privacy summary- Returns:
- updated session
-
checkpoint
Adds a checkpoint and atomically publishes the updated session.- Parameters:
checkpoint- checkpoint to add- Returns:
- updated session
-
checkpoint
Adds a checkpoint and its sanitized-text summary atomically.- Parameters:
checkpoint- checkpoint to addsummary- safe privacy summary- Returns:
- updated session
-
stop
Completes and atomically publishes the session.- Parameters:
stoppedAt- stop time- Returns:
- completed session
-
markIncomplete
Explicitly marks an interrupted session while keeping it readable.- Parameters:
interruptedAt- interruption time- Returns:
- incomplete interrupted session
-
read
-