コード例 #1
0
  @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;
  }
コード例 #2
0
  private List<IJobTrigger> getBlockOutJobTriggers() {
    List<IJobTrigger> blockOutJobTriggers = new ArrayList<IJobTrigger>();

    for (Job blockOutJob : getBlockOutJobs()) {
      blockOutJobTriggers.add(blockOutJob.getJobTrigger());
    }

    return blockOutJobTriggers;
  }
コード例 #3
0
 @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);
   }
 }