Record Class CaptureSession

java.lang.Object
java.lang.Record
com.shaft.capture.model.CaptureSession
Record Components:
schemaVersion - recording schema version
sessionId - stable capture identifier
status - session status
startedAt - capture start time
endedAt - capture end time when stopped
browser - browser metadata
events - ordered capture events
checkpoints - ordered human-review checkpoints
dataReferences - external data references used by events
redactionSummary - safe privacy summary
extensions - 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.
  • Field Details

    • CURRENT_SCHEMA_VERSION

      public static final String CURRENT_SCHEMA_VERSION
      Current persisted schema version.
      See Also:
  • Constructor Details

  • Method Details

    • start

      public static CaptureSession start(String sessionId, Instant startedAt, BrowserMetadata browser)
      Starts an incomplete session that remains readable after interruption.
      Parameters:
      sessionId - stable capture identifier
      startedAt - capture start
      browser - browser metadata
      Returns:
      new incomplete session
    • append

      public CaptureSession append(CaptureEvent event)
      Returns a copy containing an additional event.
      Parameters:
      event - event to append
      Returns:
      updated session
    • checkpoint

      public CaptureSession checkpoint(Checkpoint 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 add
      summary - privacy summary to merge
      Returns:
      updated session
    • complete

      public CaptureSession complete(Instant stoppedAt)
      Returns a completed copy.
      Parameters:
      stoppedAt - stop time
      Returns:
      completed session
    • interrupt

      public CaptureSession interrupt(Instant interruptedAt)
      Returns an explicitly interrupted incomplete copy.
      Parameters:
      interruptedAt - interruption time
      Returns:
      incomplete session with an end time
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • schemaVersion

      public String schemaVersion()
      Returns the value of the schemaVersion record component.
      Returns:
      the value of the schemaVersion record component
    • sessionId

      public String sessionId()
      Returns the value of the sessionId record component.
      Returns:
      the value of the sessionId record component
    • status

      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • startedAt

      public Instant startedAt()
      Returns the value of the startedAt record component.
      Returns:
      the value of the startedAt record component
    • endedAt

      public Instant endedAt()
      Returns the value of the endedAt record component.
      Returns:
      the value of the endedAt record component
    • browser

      public BrowserMetadata browser()
      Returns the value of the browser record component.
      Returns:
      the value of the browser record component
    • events

      public List<CaptureEvent> events()
      Returns the value of the events record component.
      Returns:
      the value of the events record component
    • checkpoints

      public List<Checkpoint> checkpoints()
      Returns the value of the checkpoints record component.
      Returns:
      the value of the checkpoints record component
    • dataReferences

      public List<ExternalTestDataReference> dataReferences()
      Returns the value of the dataReferences record component.
      Returns:
      the value of the dataReferences record component
    • redactionSummary

      public RedactionSummary redactionSummary()
      Returns the value of the redactionSummary record component.
      Returns:
      the value of the redactionSummary record component
    • extensions

      public Map<String, com.fasterxml.jackson.databind.JsonNode> extensions()
      Returns the value of the extensions record component.
      Returns:
      the value of the extensions record component