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: - BatchException – if unable to retrieve the job list
Returns: org.motechproject.batch.mds.BatchJob
which contains list oforg.motechproject.batch.model.BatchJobDTO
(contains fields fromorg.motechproject.batch.mds.BatchJob
)
rescheduleJob¶
scheduleJob¶
-
void
scheduleJob
(CronJobScheduleParam params)¶ Schedule a new cron job with given job name and cron expression.
Parameters: - params –
CronJobScheduleParam
object containing jobName, paramsMap and cronExpression
Throws: - BatchException – if unable to schedule the job
- params –
scheduleOneTimeJob¶
-
void
scheduleOneTimeJob
(OneTimeJobScheduleParams params)¶ Schedule a one time job, to be run once in the future.
Parameters: - params –
OneTimeJobScheduleParams
object containing jobName, paramsMap and date
Throws: - BatchException – if unable to schedule the job
- params –
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: - BatchException – if unable to unschedule the job
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: - BatchException – if unable to update the job