Class SpeechToTextDatabase

java.lang.Object
org.opencastproject.speechtotext.async.persistence.SpeechToTextDatabase

public class SpeechToTextDatabase extends Object
  • Field Details

    • PERSISTENCE_UNIT

      public static final String PERSISTENCE_UNIT
      JPA persistence unit name
      See Also:
    • emf

      protected javax.persistence.EntityManagerFactory emf
      Factory used to create entity managers for transactions
    • dbSessionFactory

      protected org.opencastproject.db.DBSessionFactory dbSessionFactory
    • db

      protected org.opencastproject.db.DBSession db
  • Constructor Details

    • SpeechToTextDatabase

      public SpeechToTextDatabase()
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
    • deactivate

      public void deactivate()
    • setEntityManagerFactory

      public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
    • setDBSessionFactory

      public void setDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory)
    • storeSpeechToTextControl

      public SpeechToTextControl storeSpeechToTextControl(String mediaPackageId, long workflowId, org.opencastproject.job.jpa.JpaJob job) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • storeSpeechToTextControl

      protected SpeechToTextControl storeSpeechToTextControl(SpeechToTextControl entity) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • findByJob

      public SpeechToTextControl findByJob(org.opencastproject.job.jpa.JpaJob job) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • findByStatus

      public List<SpeechToTextControl> findByStatus(SpeechToTextControl.Status... status) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Returns a list of STT controls that are in one of the status passed.
      Parameters:
      status - Status list to search
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • findByWorkflowId

      public List<SpeechToTextControl> findByWorkflowId(long workflowId) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Returns a list of STT controls that were created in the scope of a specific workflow.
      Parameters:
      workflowId -
      Returns:
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • findDistinctWorkflowIdByStatus

      public List<Long> findDistinctWorkflowIdByStatus(SpeechToTextControl.Status... status) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • findDistinctWorkflowIdByMediaPackageId

      public List<Long> findDistinctWorkflowIdByMediaPackageId(String mpId) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • updateStatusByJob

      public int updateStatusByJob(SpeechToTextControl.Status status, org.opencastproject.job.jpa.JpaJob... jobs) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • deleteByWorkflow

      public int deleteByWorkflow(long workflowId) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
    • transitionStatusByDate

      public int transitionStatusByDate(SpeechToTextControl.Status newStatus, Date olderThan, SpeechToTextControl.Status... oldStatus) throws org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException
      Throws:
      org.opencastproject.speechtotext.async.api.SpeechToTextAsyncException