Class IBMWatsonTranscriptionService
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.transcription.ibmwatson.IBMWatsonTranscriptionService
- All Implemented Interfaces:
org.opencastproject.job.api.JobProducer,org.opencastproject.transcription.api.TranscriptionService
public class IBMWatsonTranscriptionService
extends org.opencastproject.job.api.AbstractJobProducer
implements org.opencastproject.transcription.api.TranscriptionService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final floatThe load introduced on the system by creating a transcription jobstatic final Stringstatic final Stringstatic final StringService configuration optionsstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringThe key to look for in the service configuration file to override the default h=job loadstatic final StringFields inherited from class org.opencastproject.job.api.AbstractJobProducer
ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) org.opencastproject.mediapackage.MediaPackageElementgetGeneratedTranscription(String mpId, String jobId, org.opencastproject.mediapackage.MediaPackageElement.Type type) protected org.opencastproject.security.api.OrganizationDirectoryServicegetReturnValues(String mpId, String jobId) protected org.opencastproject.security.api.SecurityServiceprotected org.opencastproject.serviceregistry.api.ServiceRegistryprotected org.opencastproject.security.api.UserDirectoryServicebooleanbooleanAllow transcription service to be disabled via config Utility to verify service is activeprotected org.apache.http.impl.client.CloseableHttpClientprotected Stringprocess(org.opencastproject.job.api.Job job) protected voidretryOrError(String jobId, String mpId, String errorMsg) voidsetAssetManager(org.opencastproject.assetmanager.api.AssetManager service) voidsetDatabase(org.opencastproject.transcription.persistence.TranscriptionDatabase service) voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) voidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) voidsetSmtpService(org.opencastproject.kernel.mail.SmtpService service) voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) voidsetWorkflowService(org.opencastproject.workflow.api.WorkflowService service) voidsetWorkingFileRepository(org.opencastproject.workingfilerepository.api.WorkingFileRepository wfr) voidsetWorkspace(org.opencastproject.workspace.api.Workspace ws) org.opencastproject.job.api.JobstartTranscription(String mpId, org.opencastproject.mediapackage.Track track) org.opencastproject.job.api.JobstartTranscription(String mpId, org.opencastproject.mediapackage.Track track, String... args) voidtranscriptionDone(String mpId, Object obj) voidtranscriptionError(String mpId, Object obj) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
DEFAULT_WF_DEF
- See Also:
-
ADMIN_URL_PROPERTY
- See Also:
-
DEFAULT_START_TRANSCRIPTION_JOB_LOAD
public static final float DEFAULT_START_TRANSCRIPTION_JOB_LOADThe load introduced on the system by creating a transcription job- See Also:
-
START_TRANSCRIPTION_JOB_LOAD_KEY
The key to look for in the service configuration file to override the default h=job load- See Also:
-
ENABLED_CONFIG
Service configuration options- See Also:
-
IBM_WATSON_SERVICE_URL_CONFIG
- See Also:
-
IBM_WATSON_USER_CONFIG
- See Also:
-
IBM_WATSON_PSW_CONFIG
- See Also:
-
IBM_WATSON_API_KEY_CONFIG
- See Also:
-
IBM_WATSON_MODEL_CONFIG
- See Also:
-
WORKFLOW_CONFIG
- See Also:
-
DISPATCH_WORKFLOW_INTERVAL_CONFIG
- See Also:
-
COMPLETION_CHECK_BUFFER_CONFIG
- See Also:
-
MAX_PROCESSING_TIME_CONFIG
- See Also:
-
NOTIFICATION_EMAIL_CONFIG
- See Also:
-
CLEANUP_RESULTS_DAYS_CONFIG
- See Also:
-
MAX_ATTEMPTS_CONFIG
- See Also:
-
RETRY_WORKLFOW_CONFIG
- See Also:
-
-
Constructor Details
-
IBMWatsonTranscriptionService
public IBMWatsonTranscriptionService()
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) - Overrides:
activatein classorg.opencastproject.job.api.AbstractJobProducer
-
startTranscription
public org.opencastproject.job.api.Job startTranscription(String mpId, org.opencastproject.mediapackage.Track track) throws org.opencastproject.transcription.api.TranscriptionServiceException - Specified by:
startTranscriptionin interfaceorg.opencastproject.transcription.api.TranscriptionService- Throws:
org.opencastproject.transcription.api.TranscriptionServiceException
-
startTranscription
public org.opencastproject.job.api.Job startTranscription(String mpId, org.opencastproject.mediapackage.Track track, String... args) - Specified by:
startTranscriptionin interfaceorg.opencastproject.transcription.api.TranscriptionService
-
transcriptionDone
public void transcriptionDone(String mpId, Object obj) throws org.opencastproject.transcription.api.TranscriptionServiceException - Specified by:
transcriptionDonein interfaceorg.opencastproject.transcription.api.TranscriptionService- Throws:
org.opencastproject.transcription.api.TranscriptionServiceException
-
transcriptionError
public void transcriptionError(String mpId, Object obj) throws org.opencastproject.transcription.api.TranscriptionServiceException - Specified by:
transcriptionErrorin interfaceorg.opencastproject.transcription.api.TranscriptionService- Throws:
org.opencastproject.transcription.api.TranscriptionServiceException
-
getLanguage
- Specified by:
getLanguagein interfaceorg.opencastproject.transcription.api.TranscriptionService
-
getReturnValues
public Map<String,Object> getReturnValues(String mpId, String jobId) throws org.opencastproject.transcription.api.TranscriptionServiceException - Specified by:
getReturnValuesin interfaceorg.opencastproject.transcription.api.TranscriptionService- Throws:
org.opencastproject.transcription.api.TranscriptionServiceException
-
process
- Specified by:
processin classorg.opencastproject.job.api.AbstractJobProducer- Throws:
Exception
-
getGeneratedTranscription
public org.opencastproject.mediapackage.MediaPackageElement getGeneratedTranscription(String mpId, String jobId, org.opencastproject.mediapackage.MediaPackageElement.Type type) throws org.opencastproject.transcription.api.TranscriptionServiceException - Specified by:
getGeneratedTranscriptionin interfaceorg.opencastproject.transcription.api.TranscriptionService- Throws:
org.opencastproject.transcription.api.TranscriptionServiceException
-
makeHttpClient
protected org.apache.http.impl.client.CloseableHttpClient makeHttpClient() -
retryOrError
protected void retryOrError(String jobId, String mpId, String errorMsg) throws org.opencastproject.transcription.persistence.TranscriptionDatabaseException - Throws:
org.opencastproject.transcription.persistence.TranscriptionDatabaseException
-
isCallbackAlreadyRegistered
public boolean isCallbackAlreadyRegistered() -
setServiceRegistry
public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) -
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) -
setUserDirectoryService
public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) -
setOrganizationDirectoryService
public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) -
setSmtpService
public void setSmtpService(org.opencastproject.kernel.mail.SmtpService service) -
setWorkspace
public void setWorkspace(org.opencastproject.workspace.api.Workspace ws) -
setWorkingFileRepository
public void setWorkingFileRepository(org.opencastproject.workingfilerepository.api.WorkingFileRepository wfr) -
setDatabase
public void setDatabase(org.opencastproject.transcription.persistence.TranscriptionDatabase service) -
setAssetManager
public void setAssetManager(org.opencastproject.assetmanager.api.AssetManager service) -
setWorkflowService
public void setWorkflowService(org.opencastproject.workflow.api.WorkflowService service) -
getServiceRegistry
protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()- Specified by:
getServiceRegistryin classorg.opencastproject.job.api.AbstractJobProducer
-
getSecurityService
protected org.opencastproject.security.api.SecurityService getSecurityService()- Specified by:
getSecurityServicein classorg.opencastproject.job.api.AbstractJobProducer
-
getUserDirectoryService
protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()- Specified by:
getUserDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer
-
getOrganizationDirectoryService
protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()- Specified by:
getOrganizationDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer
-
isEnabled
public boolean isEnabled()Allow transcription service to be disabled via config Utility to verify service is active- Returns:
- true if service is enabled, false if service should be skipped
-