Tabnine Logo
ServiceRegistry.createJob
Code IndexAdd Tabnine to your IDE (free)

How to use
createJob
method
in
org.opencastproject.serviceregistry.api.ServiceRegistry

Best Java code snippets using org.opencastproject.serviceregistry.api.ServiceRegistry.createJob (Showing top 8 results out of 315)

origin: opencast/opencast

@Override
public Job animate(URI animation, Map<String, String> metadata, List<String> arguments) throws AnimateServiceException {
 Gson gson = new Gson();
 List<String> jobArguments = Arrays.asList(animation.toString(), gson.toJson(metadata), gson.toJson(arguments));
 try {
  logger.debug("Create animate service job");
  return serviceRegistry.createJob(JOB_TYPE, OPERATION, jobArguments, jobLoad);
 } catch (ServiceRegistryException e) {
  throw new AnimateServiceException(e);
 }
}
origin: opencast/opencast

/**
 * {@inheritDoc}
 *
 * @see org.opencastproject.waveform.api.WaveformService#createWaveformImage(org.opencastproject.mediapackage.Track,
 *         int, int, int, int)
 */
@Override
public Job createWaveformImage(Track sourceTrack, int pixelsPerMinute, int minWidth, int maxWidth, int height)
  throws MediaPackageException, WaveformServiceException {
 try {
  return serviceRegistry.createJob(jobType, Operation.Waveform.toString(),
      Arrays.asList(MediaPackageElementParser.getAsXml(sourceTrack), Integer.toString(pixelsPerMinute),
       Integer.toString(minWidth), Integer.toString(maxWidth), Integer.toString(height)), waveformJobLoad);
 } catch (ServiceRegistryException ex) {
  throw new WaveformServiceException("Unable to create waveform job", ex);
 }
}
origin: opencast/opencast

/**
 * {@inheritDoc}
 *
 * @see org.opencastproject.inspection.api.MediaInspectionService#inspect(java.net.URI, java.util.Map)
 */
@Override
public Job inspect(URI uri, final Map<String,String> options) throws MediaInspectionException {
 assert (options != null);
 try {
  return serviceRegistry.createJob(JOB_TYPE, Operation.Inspect.toString(), Arrays.asList(uri.toString(),
      Options.toJson(options)), inspectJobLoad);
 } catch (ServiceRegistryException e) {
  throw new MediaInspectionException(e);
 }
}
origin: opencast/opencast

/**
 * {@inheritDoc}
 *
 * @see org.opencastproject.sox.api.SoxService#normalize(Track, Float)
 */
@Override
public Job normalize(Track sourceAudioTrack, Float targetRmsLevDb) throws MediaPackageException, SoxException {
 try {
  return serviceRegistry.createJob(JOB_TYPE, Operation.Normalize.toString(),
      Arrays.asList(MediaPackageElementParser.getAsXml(sourceAudioTrack), targetRmsLevDb.toString()),
      normalizeJobLoad);
 } catch (ServiceRegistryException e) {
  throw new SoxException("Unable to create a job", e);
 }
}
origin: opencast/opencast

/**
 * {@inheritDoc}
 *
 * @see org.opencastproject.timelinepreviews.api.TimelinePreviewsService#createTimelinePreviewImages(org.opencastproject.mediapackage.Track, int)
 */
@Override
public Job createTimelinePreviewImages(Track track, int imageCount) throws TimelinePreviewsException,
    MediaPackageException {
 try {
  List<String> parameters = Arrays.asList(MediaPackageElementParser.getAsXml(track), Integer.toString(imageCount));
  return serviceRegistry.createJob(JOB_TYPE,
    Operation.TimelinePreview.toString(),
    parameters,
    timelinepreviewsJobLoad);
 } catch (ServiceRegistryException e) {
  throw new TimelinePreviewsException("Unable to create timelinepreviews job", e);
 }
}
origin: opencast/opencast

/**
 * {@inheritDoc}
 *
 * @see org.opencastproject.sox.api.SoxService#analyze(Track)
 */
@Override
public Job analyze(Track sourceAudioTrack) throws MediaPackageException, SoxException {
 try {
  return serviceRegistry.createJob(JOB_TYPE, Operation.Analyze.toString(),
      Arrays.asList(MediaPackageElementParser.getAsXml(sourceAudioTrack)), analyzeJobLoad);
 } catch (ServiceRegistryException e) {
  throw new SoxException("Unable to create a job", e);
 }
}
origin: opencast/opencast

 @Override public Job nop() {
  try {
   return getServiceRegistry().createJob(getJobType(), "nop");
  } catch (ServiceRegistryException e) {
   return chuck(e);
  }
 }
}
origin: opencast/opencast

/**
 * {@inheritDoc}
 *
 * @see org.opencastproject.inspection.api.MediaInspectionService#enrich(org.opencastproject.mediapackage.MediaPackageElement,
 *      boolean, java.util.Map)
 */
@Override
public Job enrich(final MediaPackageElement element, final boolean override, final Map<String,String> options)
    throws MediaInspectionException, MediaPackageException {
 assert (options != null);
 try {
  return serviceRegistry.createJob(JOB_TYPE, Operation.Enrich.toString(),
      Arrays.asList(MediaPackageElementParser.getAsXml(element), Boolean.toString(override),
      Options.toJson(options)), enrichJobLoad);
 } catch (ServiceRegistryException e) {
  throw new MediaInspectionException(e);
 }
}
org.opencastproject.serviceregistry.apiServiceRegistrycreateJob

Javadoc

Create and store a new job that will be dispatched as soon as possible. This is equivalent to calling #createJob(String,String,List,String,boolean) with an empty argument list.

Note that this job will be linked to the current job as its parent. Use #createJob(String,String,List,String,boolean,Job) and pass null as the job if you don't need the link.

Popular methods of ServiceRegistry

  • getCurrentJob
    Gets the current running job
  • getJob
    Gets a receipt by its ID, or null if not found
  • count
    Count the number of jobs that match the specified parameters.
  • getHostRegistrations
    Finds all host registrations, including offline hosts and those in maintenance mode.
  • getMaxLoadOnNode
    Returns the maximum load that can be handled by a given node. Note that this load is *not* 1-to-1 eq
  • getOwnLoad
    Gets the load value for the current host (ie, the host this service registry lives on
  • getServiceRegistrationsByLoad
    Finds the service registrations for this kind of job, ordered by load (lightest to heaviest).
  • incident
    Return a facility to record job incidents.
  • setCurrentJob
    Sets the current running job
  • updateJob
    Update the job in the database
  • countByHost
    Count the number of jobs in this Status on this host
  • countByOperation
    Count the number of jobs running the given operation in this Status.
  • countByHost,
  • countByOperation,
  • countOfAbnormalServices,
  • disableHost,
  • enableHost,
  • getActiveJobs,
  • getChildJobs,
  • getCurrentHostLoads,
  • getJobs

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now