JobService

public interface JobService

Interface to schedule reschedule jobs or update job parameters

Author:Naveen

Methods

countJobs

long countJobs()

Returns the total count of batch jobs.

Returns:the number of batch jobs

getListOfJobs

BatchJobListDTO getListOfJobs()

Get the list of scheduled jobs/

Throws:
Returns:

org.motechproject.batch.mds.BatchJob which contains list of org.motechproject.batch.model.BatchJobDTO(contains fields from org.motechproject.batch.mds.BatchJob)

rescheduleJob

void rescheduleJob(String jobName, String cronExpression)

Re-schedule an existing batch job with given job name and cron expression.

Parameters:
  • jobName – job name for the job to be scheduled
  • cronExpression – cron expression for the job (specified for the timely run of the job)

scheduleJob

void scheduleJob(CronJobScheduleParam params)

Schedule a new cron job with given job name and cron expression.

Parameters:
Throws:

scheduleOneTimeJob

void scheduleOneTimeJob(OneTimeJobScheduleParams params)

Schedule a one time job, to be run once in the future.

Parameters:
Throws:

unscheduleJob

void unscheduleJob(String jobName)

Unschedule an existing batch job with given job name.

Parameters:
  • jobName – job name for the job to be scheduled
Throws:

updateJobProperty

void updateJobProperty(String jobName, Map<String, String> paramsMap)

Update the job parameters of the scheduled job.

Parameters:
  • jobName – job name for the job for which parameters to be updated
  • paramsMap – list of parameters to be added or changed
Throws: