Interface JobProducer

All Known Subinterfaces:
IngestService
All Known Implementing Classes:
AbstractCoverImageService, AbstractDistributionService, AbstractJobProducer, AmberscriptTranscriptionService, AssetManagerJobProducer, AwsS3DistributionServiceImpl, CaptionServiceImpl, ComposerServiceImpl, ConfigurablePublicationServiceImpl, CoverImageServiceOsgiImpl, CropServiceImpl, DownloadDistributionServiceImpl, ExecuteServiceImpl, GoogleSpeechTranscriptionService, IBMWatsonTranscriptionService, IngestDownloadServiceImpl, IngestServiceImpl, MediaInspectionServiceImpl, MicrosoftAzureTranscriptionService, NopServiceImpl, OaiPmhPublicationServiceImpl, OsgiAbstractJobProducer, SearchServiceImpl, SilenceDetectionServiceImpl, 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 Type
    Method
    Description
    void
    Asks the job producer to handle the given job using the provided operation and list of arguments.
    long
    Get the number of jobs in a current status on all nodes.
    The type of jobs that this producer creates.
    boolean
    Whether the job can be accepted.
    boolean
    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

      long countJobs(Job.Status status) throws ServiceRegistryException
      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

      void acceptJob(Job job) throws ServiceRegistryException
      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

      boolean isReadyToAcceptJobs(String operation) throws ServiceRegistryException
      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

      boolean isReadyToAccept(Job job) throws ServiceRegistryException, UndispatchableJobException
      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 requested
      UndispatchableJobException - if the job will never be accepted because it is unacceptable