@Override public List<IJobTrigger> willBlockSchedules(IJobTrigger testBlockOutJobTrigger) { List<IJobTrigger> blockedSchedules = new ArrayList<IJobTrigger>(); List<Job> scheduledJobs = new ArrayList<Job>(); try { scheduledJobs = this.scheduler.getJobs( new IJobFilter() { @Override public boolean accept(Job job) { return !BLOCK_OUT_JOB_NAME.equals(job.getJobName()); } }); } catch (SchedulerException e) { throw new RuntimeException(e); } // Loop over trigger group names for (Job scheduledJob : scheduledJobs) { // Add schedule to list if block out conflicts at all if (BlockoutManagerUtil.willBlockSchedule( scheduledJob.getJobTrigger(), testBlockOutJobTrigger, this.scheduler)) { blockedSchedules.add(scheduledJob.getJobTrigger()); } } return blockedSchedules; }
private List<IJobTrigger> getBlockOutJobTriggers() { List<IJobTrigger> blockOutJobTriggers = new ArrayList<IJobTrigger>(); for (Job blockOutJob : getBlockOutJobs()) { blockOutJobTriggers.add(blockOutJob.getJobTrigger()); } return blockOutJobTriggers; }
@Override public IJobTrigger getBlockOut(String blockOutJobId) { try { Job blockOutJob = this.scheduler.getJob(blockOutJobId); IJobTrigger blockOutJobTrigger = blockOutJob.getJobTrigger(); blockOutJobTrigger.setDuration( ((Number) blockOutJob.getJobParams().get(DURATION_PARAM)).longValue()); return blockOutJobTrigger; } catch (SchedulerException e) { throw new RuntimeException(e); } }