public class ScheduledJobAccess extends BaseAccess
Constructor and Description |
---|
ScheduledJobAccess() |
Modifier and Type | Method and Description |
---|---|
void |
createJob(ScheduledJobDAO jobDAO,
java.util.HashMap<java.lang.String,java.lang.String> jobParams)
Create a job in the database
|
void |
createJob(java.lang.String name,
java.lang.String triggerName,
java.lang.String groupName,
java.lang.Class<org.quartz.Job> jobClass,
java.util.Calendar startTime,
java.util.Calendar endTime,
int intervalValue,
java.lang.String intervalUnit,
java.util.HashMap<java.lang.String,java.lang.String> jobParams)
Create a job in the database.
|
java.util.HashMap<java.lang.Long,ScheduledJobDAO> |
getAllJobs(java.lang.String groupName)
Get all jobs for a given group.
|
ScheduledJobDAO |
getJob(java.lang.Long jobId)
Get a job based on it's id
|
ScheduledJobDAO |
getJobByName(java.lang.String jobName)
Get a job by it's name
|
java.util.HashMap<java.lang.Long,ScheduledJobDAO> |
getJobsWithParameter(java.lang.String groupName,
java.lang.String paramName,
java.lang.String paramValue)
Get all jobs that have a given parameter with a given value
|
protected ScheduledJobDAO |
populateDAO(java.sql.ResultSet resultSet)
Populate a job data object with the current row in a resultset
|
void |
updateJobStatus(ScheduledJobDAO jobDAO)
Update the status of a job in the database
|
closeDBObjects
public ScheduledJobAccess() throws AccessException
AccessException
public ScheduledJobDAO getJob(java.lang.Long jobId) throws AccessException
jobId
- the id of the job in the databaseAccessException
public ScheduledJobDAO getJobByName(java.lang.String jobName) throws AccessException
jobName
- the name of the job to getAccessException
public java.util.HashMap<java.lang.Long,ScheduledJobDAO> getJobsWithParameter(java.lang.String groupName, java.lang.String paramName, java.lang.String paramValue) throws AccessException
groupName
- the group to which the job belongs. This keeps us from
returning unrelated jobs that just happen to have a similar
parameterparamName
- the name of the parameter we are looking forparamValue
- the value of the parameter we are looking forAccessException
public java.util.HashMap<java.lang.Long,ScheduledJobDAO> getAllJobs(java.lang.String groupName) throws AccessException
groupName
- the name of the group we want to searchAccessException
public void createJob(java.lang.String name, java.lang.String triggerName, java.lang.String groupName, java.lang.Class<org.quartz.Job> jobClass, java.util.Calendar startTime, java.util.Calendar endTime, int intervalValue, java.lang.String intervalUnit, java.util.HashMap<java.lang.String,java.lang.String> jobParams) throws AccessException
name
- the name of the job. This should be uniquetriggerName
- the name of the trigger that is registered in the scheduler
servicegroupName
- the group of the jobjobClass
- the class that implements the job functionality. The name of
this class will be extracted and put into the database.startTime
- the time when the job should first runintervalValue
- the amount of time between job runs.intervalUnit
- the unit of time that the intervalValue represents. Valid
values are s,m,h, d and wjobParams
- a map of parameters that are associated with this job.AccessException
public void createJob(ScheduledJobDAO jobDAO, java.util.HashMap<java.lang.String,java.lang.String> jobParams) throws AccessException
jobDAO
- the job data object that holds necessary informationjobParams
- a map of parameters that are associated with this job.AccessException
public void updateJobStatus(ScheduledJobDAO jobDAO) throws AccessException
jobDAO
- the job data object that we want to change. The status should
already have been updated in this objectAccessException
protected ScheduledJobDAO populateDAO(java.sql.ResultSet resultSet) throws java.sql.SQLException
populateDAO
in class BaseAccess
resultSet
- the result set which is already pointing to the desired row.java.sql.SQLException
Copyright © 2020 Regents of the University of California. All Rights Reserved.