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 transcriptionprogress- the pieces transcribed out of the pieces to transcribe ("3/9"), or nullerror- the message code of the last failure, or nulllanguage- the ISO-639-1 language of the transcript, or nulldurationSeconds- the duration of the media, or null when not measuredupdated- when the state last changed, in milliseconds since the epoch, or nullhasSegments- whether the transcript has timed segmentshasChapters- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final longHow 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. -
Constructor Summary
ConstructorsConstructorDescriptionTranscriptionState(TranscriptionStatus status, String progress, String error, String language, Long durationSeconds, Long updated, boolean hasSegments, boolean hasChapters, boolean media) Creates an instance of aTranscriptionStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedurationSecondsrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.booleanReturns the value of thehasChaptersrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasSegmentsrecord component.booleanisInProgress(long now) Tells whether the transcription is queued or running, and still moving.language()Returns the value of thelanguagerecord component.booleanmedia()Returns the value of themediarecord component.progress()Returns the value of theprogressrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.updated()Returns the value of theupdatedrecord component.
-
Field Details
-
STALE_MILLIS
public static final long STALE_MILLISHow 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 aTranscriptionStaterecord class.- Parameters:
status- the value for thestatusrecord componentprogress- the value for theprogressrecord componenterror- the value for theerrorrecord componentlanguage- the value for thelanguagerecord componentdurationSeconds- the value for thedurationSecondsrecord componentupdated- the value for theupdatedrecord componenthasSegments- the value for thehasSegmentsrecord componenthasChapters- the value for thehasChaptersrecord componentmedia- the value for themediarecord 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_MILLISago
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
status
-
progress
-
error
-
language
-
durationSeconds
Returns the value of thedurationSecondsrecord component.- Returns:
- the value of the
durationSecondsrecord component
-
updated
-
hasSegments
public boolean hasSegments()Returns the value of thehasSegmentsrecord component.- Returns:
- the value of the
hasSegmentsrecord component
-
hasChapters
public boolean hasChapters()Returns the value of thehasChaptersrecord component.- Returns:
- the value of the
hasChaptersrecord component
-
media
-