public class SchedulerService extends BaseService
_serviceName| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
deleteJob(ScheduledJobDAO jobDAO)
Remove the job from the scheduler and set the job status to deleted in the database
|
java.lang.String |
deleteJob(java.lang.String jobName)
Remove the job from the scheduler and set the job status to deleted in the database
|
void |
doRefresh() |
static SchedulerService |
getInstance()
Get the single instance of SchedulerService.
|
java.lang.String |
getJobInfoXML(java.lang.Long jobId)
Get information about the job in XML format
|
java.lang.String |
getJobsInfoXML(java.lang.String groupName,
java.lang.String paramName,
java.lang.String paramValue)
Get the information for jobs in a group in an xml format.
|
void |
getJobsInfoXML(java.lang.String groupName,
java.lang.String paramName,
java.lang.String paramValue,
java.io.PrintWriter pw)
Get the information for jobs in a group in an xml format.
|
java.util.Calendar |
getStartDateFromDelay(java.lang.String delay)
Extract the start date from the delay value
|
protected java.util.Vector<java.lang.String> |
getStatus() |
java.lang.String |
jobToXML(ScheduledJobDAO scheduledJobDAO)
Convert a single job to XML
|
boolean |
refreshable() |
java.lang.String |
rescheduleJob(ScheduledJobDAO jobDAO,
java.lang.String username,
java.lang.String[] groups)
Reschedule a job.
|
java.lang.String |
rescheduleJob(ScheduledJobDAO jobDAO,
java.lang.String username,
java.lang.String[] groups,
boolean checkStatus)
Reschedule a job.
|
java.lang.String |
scheduleDelayedJob(java.lang.String jobName,
java.lang.String delay,
java.lang.String jobClassName,
java.lang.String jobGroup,
java.util.HashMap<java.lang.String,java.lang.String> jobParams,
java.lang.String username,
java.lang.String[] groups)
schedule a job one time with a given delay.
|
java.lang.String |
scheduleJob(ScheduledJobDAO jobDAO,
java.lang.String username,
java.lang.String[] groups)
Schedule a job
|
java.lang.String |
scheduleJob(java.lang.String jobName,
java.util.Calendar startCal,
java.util.Calendar endCal,
int intervalValue,
java.lang.String intervalUnit,
java.lang.String jobClassName,
java.lang.String jobGroup,
java.util.HashMap<java.lang.String,java.lang.String> jobParams)
schedule a job
|
void |
start() |
void |
stop() |
java.lang.String |
unscheduleJob(java.lang.String jobName,
java.lang.String username,
java.lang.String[] groups)
Unschedule a job.
|
refreshpublic static SchedulerService getInstance() throws ServiceException
ServiceExceptionpublic boolean refreshable()
refreshable in class BaseServicepublic void doRefresh()
throws ServiceException
doRefresh in class BaseServiceServiceExceptionpublic void start()
throws ServiceException
ServiceExceptionpublic void stop()
throws ServiceException
stop in class BaseServiceServiceExceptionprotected java.util.Vector<java.lang.String> getStatus()
throws ServiceException
ServiceExceptionpublic java.lang.String scheduleJob(ScheduledJobDAO jobDAO, java.lang.String username, java.lang.String[] groups) throws ServiceException
jobDAO - the job data object to scheduleusername - the user that we will use to schedulegroups - the user group that we will use to scheduleServiceExceptionpublic java.lang.String scheduleJob(java.lang.String jobName,
java.util.Calendar startCal,
java.util.Calendar endCal,
int intervalValue,
java.lang.String intervalUnit,
java.lang.String jobClassName,
java.lang.String jobGroup,
java.util.HashMap<java.lang.String,java.lang.String> jobParams)
throws ServiceException
jobName - the name of the jobstartCal - a calendar holding the start date of the jobendCal - a calendar holding the end date of the jobintervalValue - the run interval for the jobintervalUnit - the unit of the run interval for the jobjobClassName - the job class namejobGroup - the job group namejobParams - a map of additional job parametersusername - the user namegroups - the user's group nameServiceExceptionpublic java.lang.String scheduleDelayedJob(java.lang.String jobName,
java.lang.String delay,
java.lang.String jobClassName,
java.lang.String jobGroup,
java.util.HashMap<java.lang.String,java.lang.String> jobParams,
java.lang.String username,
java.lang.String[] groups)
throws ServiceException
jobName - the name of the jobdelay - the delay in seconds, minutes, hours or days from the time
this method is called (i.e. 30s, 5m, 2h, 1d)jobClassName - the job class namejobGroup - the job group namejobParams - a map of additional job parametersusername - the user namegroups - the user's group nameServiceExceptionpublic java.lang.String unscheduleJob(java.lang.String jobName,
java.lang.String username,
java.lang.String[] groups)
throws ServiceException
jobName - the name of the job to unscheduleusername - the user namegroups - the user's group nameServiceExceptionpublic java.lang.String rescheduleJob(ScheduledJobDAO jobDAO, java.lang.String username, java.lang.String[] groups) throws ServiceException
jobDAO - the job data object holding the information about the job to rescheduleusername - the user namegroups - the user's group nameServiceExceptionpublic java.lang.String rescheduleJob(ScheduledJobDAO jobDAO, java.lang.String username, java.lang.String[] groups, boolean checkStatus) throws ServiceException
jobDAO - the job data object holding the information about the job to
rescheduleusername - the user namegroups - the user's group namecheckStatus - if set to true, the method will check to make sure the status
is UNSCHEDULED before restarting. Otherwise, the method will
not check. This is so that we can restart a service at startup
that was running when metacat was shut down.ServiceExceptionpublic java.lang.String deleteJob(java.lang.String jobName)
throws ServiceException
jobName - the string holding the name of the job to deleteusername - the user namegroups - the user's group nameServiceExceptionpublic java.lang.String deleteJob(ScheduledJobDAO jobDAO) throws ServiceException
jobDAO - the job data object holding the information about the job to deleteusername - the user namegroups - the user's group nameServiceExceptionpublic java.lang.String getJobInfoXML(java.lang.Long jobId)
throws ServiceException
jobId - the job for which we want the informationServiceExceptionpublic java.lang.String getJobsInfoXML(java.lang.String groupName,
java.lang.String paramName,
java.lang.String paramValue)
throws ServiceException
groupName - the job group that we are searching forparamName - the parameter name that we are looking for. this is ignored if
nullparamValue - the parameter value that we are looking for. this is ignored
if nullServiceExceptionpublic void getJobsInfoXML(java.lang.String groupName,
java.lang.String paramName,
java.lang.String paramValue,
java.io.PrintWriter pw)
throws ServiceException
groupName - the job group that we are searching forparamName - the parameter name that we are looking for. this is ignored if
nullparamValue - the parameter value that we are looking for. this is ignored
if nullServiceExceptionpublic java.lang.String jobToXML(ScheduledJobDAO scheduledJobDAO) throws ServiceException
scheduledJobDAO - the job we want to convertServiceExceptionpublic java.util.Calendar getStartDateFromDelay(java.lang.String delay)
throws ServiceException
delay - a string representing the start delay in ServiceExceptionCopyright © 2020 Regents of the University of California. All Rights Reserved.