Class VideoConversionWork

java.lang.Object
org.nuxeo.ecm.core.work.AbstractWork
org.nuxeo.ecm.platform.video.service.VideoConversionWork
All Implemented Interfaces:
Serializable, Work

public class VideoConversionWork extends AbstractWork
Work running a defined video conversion.
Since:
5.6
See Also:
  • Field Details

  • Constructor Details

    • VideoConversionWork

      public VideoConversionWork(String repositoryName, String docId, String conversionName)
  • Method Details

    • computeIdPrefix

      protected static String computeIdPrefix(String repositoryName, String docId)
    • getCategory

      public String getCategory()
      Description copied from interface: Work
      Gets the category for this work.

      Used to choose an execution queue.

      Specified by:
      getCategory in interface Work
      Overrides:
      getCategory in class AbstractWork
      Returns:
      the category, or null for the default
    • getTitle

      public String getTitle()
      Description copied from interface: Work
      Gets a human-readable name for this work instance.
      Returns:
      a human-readable name
    • work

      public void work()
      Description copied from interface: Work
      This method should implement the actual work done by the Work instance.

      It should periodically update its progress through Work.setProgress(org.nuxeo.ecm.core.work.api.Work.Progress).

      To allow for suspension by the WorkManager, it should periodically call Work.isSuspending(), and if true call Work.suspended() return early with saved state data.

      Clean up can by implemented by Work.cleanUp(boolean, Exception).

      Specified by:
      work in interface Work
      Specified by:
      work in class AbstractWork
      See Also:
    • isIdempotent

      public boolean isIdempotent()
      Description copied from interface: Work
      Returns true if a work with a given Work.getId() should always produce the same result. The WorkManager implementation can safely skip duplicate executions of idempotent work.
    • isGroupJoin

      public boolean isGroupJoin()
      Description copied from interface: Work
      When true the Work is part of a group, Works of the group have the same Work.getPartitionKey(). When all Works of the group are done the Work.onGroupJoinCompletion() hook is called.
    • getPartitionKey

      public String getPartitionKey()
      Description copied from interface: Work
      Returns a key that can be used by the WorkManager implementation to guarantee that works with the same partition key will be executed in the order they are submitted.
      Specified by:
      getPartitionKey in interface Work
      Overrides:
      getPartitionKey in class AbstractWork
    • onGroupJoinCompletion

      public void onGroupJoinCompletion()
      Description copied from interface: Work
      Called when Work.isGroupJoin() returns true and after the last Work of the group.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class AbstractWork
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractWork
    • getVideoToConvert

      protected Video getVideoToConvert(DocumentModel doc)
    • resetTranscodedVideos

      protected void resetTranscodedVideos(DocumentModel doc)
    • saveNewTranscodedVideo

      protected void saveNewTranscodedVideo(DocumentModel doc, TranscodedVideo transcodedVideo)
    • fireVideoConversionsDoneEvent

      protected void fireVideoConversionsDoneEvent()
      Fire a VIDEO_CONVERSIONS_DONE_EVENT event when no other VideoConversionWork is scheduled for this document.
      Since:
      5.8