Class SpeechToTextDatabase
java.lang.Object
org.opencastproject.speechtotext.async.persistence.SpeechToTextDatabase
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DBSessionprotected DBSessionFactoryprotected javax.persistence.EntityManagerFactoryFactory used to create entity managers for transactionsstatic final StringJPA persistence unit name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) voidintdeleteByWorkflow(long workflowId) findByStatus(SpeechToTextControl.Status... status) Returns a list of STT controls that are in one of the status passed.findByWorkflowId(long workflowId) Returns a list of STT controls that were created in the scope of a specific workflow.voidsetDBSessionFactory(DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) storeSpeechToTextControl(String mediaPackageId, long workflowId, JpaJob job) protected SpeechToTextControlinttransitionStatusByDate(SpeechToTextControl.Status newStatus, Date olderThan, SpeechToTextControl.Status... oldStatus) intupdateStatusByJob(SpeechToTextControl.Status status, JpaJob... jobs)
-
Field Details
-
PERSISTENCE_UNIT
JPA persistence unit name- See Also:
-
emf
protected javax.persistence.EntityManagerFactory emfFactory used to create entity managers for transactions -
dbSessionFactory
-
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
-
storeSpeechToTextControl
public SpeechToTextControl storeSpeechToTextControl(String mediaPackageId, long workflowId, JpaJob job) throws SpeechToTextAsyncException - Throws:
SpeechToTextAsyncException
-
storeSpeechToTextControl
protected SpeechToTextControl storeSpeechToTextControl(SpeechToTextControl entity) throws SpeechToTextAsyncException - Throws:
SpeechToTextAsyncException
-
findByJob
- Throws:
SpeechToTextAsyncException
-
findByStatus
public List<SpeechToTextControl> findByStatus(SpeechToTextControl.Status... status) throws SpeechToTextAsyncException Returns a list of STT controls that are in one of the status passed.- Parameters:
status- Status list to search- Throws:
SpeechToTextAsyncException
-
findByWorkflowId
public List<SpeechToTextControl> findByWorkflowId(long workflowId) throws SpeechToTextAsyncException Returns a list of STT controls that were created in the scope of a specific workflow.- Parameters:
workflowId-- Returns:
- Throws:
SpeechToTextAsyncException
-
findDistinctWorkflowIdByStatus
public List<Long> findDistinctWorkflowIdByStatus(SpeechToTextControl.Status... status) throws SpeechToTextAsyncException - Throws:
SpeechToTextAsyncException
-
findDistinctWorkflowIdByMediaPackageId
public List<Long> findDistinctWorkflowIdByMediaPackageId(String mpId) throws SpeechToTextAsyncException - Throws:
SpeechToTextAsyncException
-
updateStatusByJob
public int updateStatusByJob(SpeechToTextControl.Status status, JpaJob... jobs) throws SpeechToTextAsyncException - Throws:
SpeechToTextAsyncException
-
deleteByWorkflow
- Throws:
SpeechToTextAsyncException
-
transitionStatusByDate
public int transitionStatusByDate(SpeechToTextControl.Status newStatus, Date olderThan, SpeechToTextControl.Status... oldStatus) throws SpeechToTextAsyncException - Throws:
SpeechToTextAsyncException
-