Class IBMWatsonTranscriptionService
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.transcription.ibmwatson.IBMWatsonTranscriptionService
- All Implemented Interfaces:
JobProducer,TranscriptionService
public class IBMWatsonTranscriptionService
extends AbstractJobProducer
implements 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) OSGI activate method.getGeneratedTranscription(String mpId, String jobId, MediaPackageElement.Type type) protected OrganizationDirectoryServiceReturns a reference to the organization directory service.getReturnValues(String mpId, String jobId) protected SecurityServiceReturns a reference to the security serviceprotected ServiceRegistryReturns a reference to the service registry.protected UserDirectoryServiceReturns a reference to the user directory servicebooleanbooleanAllow transcription service to be disabled via config Utility to verify service is activeprotected org.apache.http.impl.client.CloseableHttpClientprotected StringAsks the overriding class to process the arguments using the given operation.protected voidretryOrError(String jobId, String mpId, String errorMsg) voidsetAssetManager(AssetManager service) voidsetDatabase(TranscriptionDatabase service) voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) voidsetSecurityService(SecurityService securityService) voidsetServiceRegistry(ServiceRegistry serviceRegistry) voidsetSmtpService(SmtpService service) voidsetUserDirectoryService(UserDirectoryService userDirectoryService) voidsetWorkflowService(WorkflowService service) voidvoidstartTranscription(String mpId, Track track) startTranscription(String mpId, 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) Description copied from class:AbstractJobProducerOSGI activate method.- Overrides:
activatein classAbstractJobProducer- Parameters:
cc- OSGI component context
-
startTranscription
- Specified by:
startTranscriptionin interfaceTranscriptionService- Throws:
TranscriptionServiceException
-
startTranscription
- Specified by:
startTranscriptionin interfaceTranscriptionService
-
transcriptionDone
- Specified by:
transcriptionDonein interfaceTranscriptionService- Throws:
TranscriptionServiceException
-
transcriptionError
- Specified by:
transcriptionErrorin interfaceTranscriptionService- Throws:
TranscriptionServiceException
-
getLanguage
- Specified by:
getLanguagein interfaceTranscriptionService
-
getReturnValues
public Map<String,Object> getReturnValues(String mpId, String jobId) throws TranscriptionServiceException - Specified by:
getReturnValuesin interfaceTranscriptionService- Throws:
TranscriptionServiceException
-
process
Description copied from class:AbstractJobProducerAsks the overriding class to process the arguments using the given operation. The result will be added to the associated job as the payload.- Specified by:
processin classAbstractJobProducer- Parameters:
job- the job to process- Returns:
- the operation result
- Throws:
Exception
-
getGeneratedTranscription
public MediaPackageElement getGeneratedTranscription(String mpId, String jobId, MediaPackageElement.Type type) throws TranscriptionServiceException - Specified by:
getGeneratedTranscriptionin interfaceTranscriptionService- Throws:
TranscriptionServiceException
-
makeHttpClient
protected org.apache.http.impl.client.CloseableHttpClient makeHttpClient() -
retryOrError
protected void retryOrError(String jobId, String mpId, String errorMsg) throws TranscriptionDatabaseException - Throws:
TranscriptionDatabaseException
-
isCallbackAlreadyRegistered
public boolean isCallbackAlreadyRegistered() -
setServiceRegistry
-
setSecurityService
-
setUserDirectoryService
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) -
setSmtpService
-
setWorkspace
-
setWorkingFileRepository
-
setDatabase
-
setAssetManager
-
setWorkflowService
-
getServiceRegistry
Description copied from class:AbstractJobProducerReturns a reference to the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducer- Returns:
- the service registry
-
getSecurityService
Description copied from class:AbstractJobProducerReturns a reference to the security service- Specified by:
getSecurityServicein classAbstractJobProducer- Returns:
- the security service
-
getUserDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the user directory service- Specified by:
getUserDirectoryServicein classAbstractJobProducer- Returns:
- the user directory service
-
getOrganizationDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the organization directory service.- Specified by:
getOrganizationDirectoryServicein classAbstractJobProducer- Returns:
- the organization directory service
-
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
-