Package org.opencastproject.job.api
Interface JobProducer
- All Known Subinterfaces:
IngestService
- All Known Implementing Classes:
AbstractCoverImageService,AbstractDistributionService,AbstractJobProducer,AmberscriptTranscriptionService,AnimateServiceImpl,AssetManagerJobProducer,AwsS3DistributionServiceImpl,CaptionServiceImpl,ComposerServiceImpl,ConfigurablePublicationServiceImpl,CoverImageServiceOsgiImpl,CropServiceImpl,DownloadDistributionServiceImpl,ExecuteServiceImpl,GoogleSpeechTranscriptionService,IBMWatsonTranscriptionService,IngestDownloadServiceImpl,IngestServiceImpl,MediaInspectionServiceImpl,MicrosoftAzureTranscriptionService,NopServiceImpl,OaiPmhPublicationServiceImpl,OsgiAbstractJobProducer,SearchServiceImpl,SilenceDetectionServiceImpl,SoxServiceImpl,SpeechToTextServiceImpl,TextAnalyzerServiceImpl,TimelinePreviewsServiceImpl,VideoEditorServiceImpl,VideoGridServiceImpl,VideoSegmenterServiceImpl,WaveformServiceImpl,WorkflowServiceImpl,WowzaStreamingDistributionService,YouTubeV3PublicationServiceImpl
public interface JobProducer
A service that creates jobs for long-running operations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAsks the job producer to handle the given job using the provided operation and list of arguments.longcountJobs(Job.Status status) Get the number of jobs in a current status on all nodes.The type of jobs that this producer creates.booleanisReadyToAccept(Job job) Whether the job can be accepted.booleanisReadyToAcceptJobs(String operation) Whether new jobs can be accepted in general.
-
Method Details
-
getJobType
String getJobType()The type of jobs that this producer creates.- Returns:
- the job type
-
countJobs
Get the number of jobs in a current status on all nodes.- Returns:
- Number of jobs in this state
- Throws:
ServiceRegistryException- if an error occurs while communicating with the backing data source
-
acceptJob
Asks the job producer to handle the given job using the provided operation and list of arguments. The implementation of this method must be asynchronous if the processing takes more than a few seconds.- Parameters:
job- the job being dispatched- Throws:
ServiceRegistryException- if the producer was unable to start work as requested
-
isReadyToAcceptJobs
Whether new jobs can be accepted in general.- Parameters:
operation- operation- Returns:
- whether the service is ready to accept jobs
- Throws:
ServiceRegistryException- if the producer was unable to start work as requested
-
isReadyToAccept
Whether the job can be accepted.- Parameters:
job- the job being dispatched- Returns:
- whether the service is ready to accept the job
- Throws:
ServiceRegistryException- if the producer was unable to start work as requestedUndispatchableJobException- if the job will never be accepted because it is unacceptable
-