Package com.almis.awe.scheduler.dao
Class CalendarDAO
java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.scheduler.dao.CalendarDAO
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
DAO to manage schedule calendars
-
Constructor Summary
ConstructorDescriptionCalendarDAO
(org.quartz.Scheduler scheduler, QueryService queryService, QueryUtil queryUtil, com.fasterxml.jackson.databind.ObjectMapper mapper) Autowired constructor -
Method Summary
Modifier and TypeMethodDescriptionactivateCalendars
(List<Integer> calendarIdList) Retrieve all tasks with the calendar set and set the calendar to their triggerscheckTriggersContainsCalendar
(Integer... calendarIdList) Check if the scheduler contains the selected calendarcomputeNextFireTimes
(int times, Schedule schedule) Compute next fire timesdeactivateCalendars
(List<Integer> calendarIdList) Retrieve all tasks with the calendar set and remove the calendar from their triggersdeleteSchedulerCalendar
(List<Integer> calendarIdList) Delete selected calendarsgetCalendar
(String alias, Integer calendarId) Get calendar for the given ID on the given databaseinsertSchedulerCalendar
(Integer calendarIde, boolean replace, boolean updateTriggers) Insert and schedule a new calendarinsertSchedulerCalendar
(String alias, Integer calendarId, boolean replace, boolean updateTriggers) Insert and schedule a new calendarvoid
Load calendars from the database to the schedulervoid
rescheduleTaskWithCalendar
(Task task, String calendarId) Reschedule task with the new calendar idupdateSchedulerCalendar
(Integer calendarIde) Update and schedule a new calendarRetrieves next 100 yearsMethods inherited from class com.almis.awe.config.ServiceConfig
containsBean, getApplicationContext, getBean, getBean, getElements, getLocale, getLocale, getProperty, getProperty, getRequest, getSession, setApplicationContext
-
Constructor Details
-
CalendarDAO
public CalendarDAO(org.quartz.Scheduler scheduler, QueryService queryService, QueryUtil queryUtil, com.fasterxml.jackson.databind.ObjectMapper mapper) Autowired constructor- Parameters:
scheduler
- SchedulerqueryService
- Query servicequeryUtil
- Query utilitiesmapper
- Object mapper
-
-
Method Details
-
loadSchedulerCalendar
Load calendars from the database to the scheduler- Throws:
AWException
- Error loading scheduler calendar
-
getCalendar
Get calendar for the given ID on the given database- Parameters:
alias
- Calendar aliascalendarId
- Calendar identifier- Returns:
- Calendar
- Throws:
AWException
- Error retrieving calendar
-
insertSchedulerCalendar
public ServiceData insertSchedulerCalendar(Integer calendarIde, boolean replace, boolean updateTriggers) throws AWException Insert and schedule a new calendar- Parameters:
calendarIde
- Calendar identifierreplace
- Replace calendarupdateTriggers
- Update task triggers- Returns:
- ServiceData
- Throws:
AWException
- Error inserting scheduler calendar
-
insertSchedulerCalendar
public ServiceData insertSchedulerCalendar(String alias, Integer calendarId, boolean replace, boolean updateTriggers) throws AWException Insert and schedule a new calendar- Parameters:
calendarId
- Calendar identifierreplace
- Replace calendarupdateTriggers
- Update task triggersalias
- Calendar alias- Returns:
- ServiceData
- Throws:
AWException
- Error inserting scheduler calendar
-
updateSchedulerCalendar
Update and schedule a new calendar- Parameters:
calendarIde
- Calendar identifier- Returns:
- ServiceData
- Throws:
AWException
- Error updating scheduler calendar
-
deleteSchedulerCalendar
Delete selected calendars- Parameters:
calendarIdList
- Calendar identifier list- Returns:
- ServiceData
- Throws:
AWException
- Error deleting calendars
-
rescheduleTaskWithCalendar
Reschedule task with the new calendar id- Parameters:
task
- Task to reschedulecalendarId
- Calendar identifier- Throws:
AWException
- Error rescheduling task with calendar
-
checkTriggersContainsCalendar
Check if the scheduler contains the selected calendar- Parameters:
calendarIdList
- Calendar identifier list- Returns:
- ServiceData
- Throws:
AWException
- Error checking triggers with calendars
-
yearSelectService
Retrieves next 100 years- Returns:
- ServiceData
-
computeNextFireTimes
Compute next fire times- Parameters:
times
- # of fire times to computeschedule
- Schedule- Returns:
- Service data
- Throws:
AWException
- Error computing next fire times
-
activateCalendars
Retrieve all tasks with the calendar set and set the calendar to their triggers- Parameters:
calendarIdList
- Calendar identifier list- Returns:
- Service data
- Throws:
AWException
-
deactivateCalendars
Retrieve all tasks with the calendar set and remove the calendar from their triggers- Parameters:
calendarIdList
- Calendar identifier list- Returns:
- Service data
- Throws:
AWException
-