Record Class CaptureSession
java.lang.Object
java.lang.Record
com.shaft.capture.model.CaptureSession
- Record Components:
schemaVersion- recording schema versionsessionId- stable capture identifierstatus- session statusstartedAt- capture start timeendedAt- capture end time when stoppedbrowser- browser metadataevents- ordered capture eventscheckpoints- ordered human-review checkpointsdataReferences- external data references used by eventsredactionSummary- safe privacy summaryextensions- forward-compatible generator or platform data
public record CaptureSession(String schemaVersion, String sessionId, CaptureSession.SessionStatus status, Instant startedAt, Instant endedAt, BrowserMetadata browser, List<CaptureEvent> events, List<Checkpoint> checkpoints, List<ExternalTestDataReference> dataReferences, RedactionSummary redactionSummary, Map<String, com.fasterxml.jackson.databind.JsonNode> extensions)
extends Record
Immutable versioned SHAFT Capture session.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSession lifecycle states. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCaptureSession(String schemaVersion, String sessionId, CaptureSession.SessionStatus status, Instant startedAt, Instant endedAt, BrowserMetadata browser, List<CaptureEvent> events, List<Checkpoint> checkpoints, List<ExternalTestDataReference> dataReferences, RedactionSummary redactionSummary, Map<String, com.fasterxml.jackson.databind.JsonNode> extensions) Creates an immutable validated session. -
Method Summary
Modifier and TypeMethodDescriptionappend(CaptureEvent event) Returns a copy containing an additional event.browser()Returns the value of thebrowserrecord component.checkpoint(Checkpoint checkpoint) Returns a copy containing an additional checkpoint.Returns the value of thecheckpointsrecord component.Returns a completed copy.Returns the value of thedataReferencesrecord component.endedAt()Returns the value of theendedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.events()Returns the value of theeventsrecord component.Returns the value of theextensionsrecord component.final inthashCode()Returns a hash code value for this object.Returns an explicitly interrupted incomplete copy.Returns the value of theredactionSummaryrecord component.Returns the value of theschemaVersionrecord component.Returns the value of thesessionIdrecord component.static CaptureSessionstart(String sessionId, Instant startedAt, BrowserMetadata browser) Starts an incomplete session that remains readable after interruption.Returns the value of thestartedAtrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.withDataReferences(List<ExternalTestDataReference> references, RedactionSummary summary) Returns a copy containing external data references and their safe summary.
-
Field Details
-
CURRENT_SCHEMA_VERSION
-
-
Constructor Details
-
CaptureSession
public CaptureSession(String schemaVersion, String sessionId, CaptureSession.SessionStatus status, Instant startedAt, Instant endedAt, BrowserMetadata browser, List<CaptureEvent> events, List<Checkpoint> checkpoints, List<ExternalTestDataReference> dataReferences, RedactionSummary redactionSummary, Map<String, com.fasterxml.jackson.databind.JsonNode> extensions) Creates an immutable validated session.
-
-
Method Details
-
start
Starts an incomplete session that remains readable after interruption.- Parameters:
sessionId- stable capture identifierstartedAt- capture startbrowser- browser metadata- Returns:
- new incomplete session
-
append
Returns a copy containing an additional event.- Parameters:
event- event to append- Returns:
- updated session
-
checkpoint
Returns a copy containing an additional checkpoint.- Parameters:
checkpoint- checkpoint to append- Returns:
- updated session
-
withDataReferences
public CaptureSession withDataReferences(List<ExternalTestDataReference> references, RedactionSummary summary) Returns a copy containing external data references and their safe summary.- Parameters:
references- references to addsummary- privacy summary to merge- Returns:
- updated session
-
complete
Returns a completed copy.- Parameters:
stoppedAt- stop time- Returns:
- completed session
-
interrupt
Returns an explicitly interrupted incomplete copy.- Parameters:
interruptedAt- interruption time- Returns:
- incomplete session with an end time
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
schemaVersion
Returns the value of theschemaVersionrecord component.- Returns:
- the value of the
schemaVersionrecord component
-
sessionId
-
status
-
startedAt
-
endedAt
-
browser
-
events
-
checkpoints
Returns the value of thecheckpointsrecord component.- Returns:
- the value of the
checkpointsrecord component
-
dataReferences
Returns the value of thedataReferencesrecord component.- Returns:
- the value of the
dataReferencesrecord component
-
redactionSummary
Returns the value of theredactionSummaryrecord component.- Returns:
- the value of the
redactionSummaryrecord component
-
extensions
Returns the value of theextensionsrecord component.- Returns:
- the value of the
extensionsrecord component
-