Record Class TranscriptionState

java.lang.Object
java.lang.Record
org.exoplatform.documents.model.TranscriptionState
Record Components:
status - where the transcription stands, null when the file was never sent to transcription
progress - the pieces transcribed out of the pieces to transcribe ("3/9"), or null
error - the message code of the last failure, or null
language - the ISO-639-1 language of the transcript, or null
durationSeconds - the duration of the media, or null when not measured
updated - when the state last changed, in milliseconds since the epoch, or null
hasSegments - whether the transcript has timed segments
hasChapters - whether the transcript is grouped into chapters (EXO-92122)
media - whether the file is an audio or a video, the only files that can be transcribed

public record TranscriptionState(TranscriptionStatus status, String progress, String error, String language, Long durationSeconds, Long updated, boolean hasSegments, boolean hasChapters, boolean media) extends Record
The transcription state of an audio or video file, as stored on the file (EXO-92097).
  • Field Details

    • STALE_MILLIS

      public static final long STALE_MILLIS
      How long a queued or running transcription may go without its state changing before a user may ask for it again: twice the AI queue's default run ceiling, a run writing its progress after each piece. A running one that old has lost its run; a queued one may still be waiting behind other runs, and asking again only makes its row due again.
      See Also:
  • Constructor Details

    • TranscriptionState

      public TranscriptionState(TranscriptionStatus status, String progress, String error, String language, Long durationSeconds, Long updated, boolean hasSegments, boolean hasChapters, boolean media)
      Creates an instance of a TranscriptionState record class.
      Parameters:
      status - the value for the status record component
      progress - the value for the progress record component
      error - the value for the error record component
      language - the value for the language record component
      durationSeconds - the value for the durationSeconds record component
      updated - the value for the updated record component
      hasSegments - the value for the hasSegments record component
      hasChapters - the value for the hasChapters record component
      media - the value for the media record component
  • Method Details

    • isInProgress

      public boolean isInProgress(long now)
      Tells whether the transcription is queued or running, and still moving.
      Parameters:
      now - the current time, in milliseconds since the epoch
      Returns:
      true when it is queued or running and its state changed less than STALE_MILLIS ago
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • status

      public TranscriptionStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • progress

      public String progress()
      Returns the value of the progress record component.
      Returns:
      the value of the progress record component
    • error

      public String error()
      Returns the value of the error record component.
      Returns:
      the value of the error record component
    • language

      public String language()
      Returns the value of the language record component.
      Returns:
      the value of the language record component
    • durationSeconds

      public Long durationSeconds()
      Returns the value of the durationSeconds record component.
      Returns:
      the value of the durationSeconds record component
    • updated

      public Long updated()
      Returns the value of the updated record component.
      Returns:
      the value of the updated record component
    • hasSegments

      public boolean hasSegments()
      Returns the value of the hasSegments record component.
      Returns:
      the value of the hasSegments record component
    • hasChapters

      public boolean hasChapters()
      Returns the value of the hasChapters record component.
      Returns:
      the value of the hasChapters record component
    • media

      public boolean media()
      Returns the value of the media record component.
      Returns:
      the value of the media record component