コード例 #1
0
 public Builder withCronSchedule(String cronExpression) {
   request.setTriggerType(TriggerType.CronTrigger);
   Map<String, String> config = new HashMap<String, String>();
   config.put(TriggerConstants.CronTrigger.CRON_EXPRESSION, cronExpression);
   request.setTriggerConfiguration(config);
   return this;
 }
コード例 #2
0
 public Builder withSimpleSchedule(Long interval, Integer count) {
   request.setTriggerType(TriggerType.SimpleTrigger);
   Map<String, String> config = new HashMap<String, String>();
   if (interval != null) {
     config.put(TriggerConstants.SimpleTrigger.REPEAT_INTERVAL, String.valueOf(interval));
   }
   if (count != null) {
     config.put(TriggerConstants.SimpleTrigger.REPEAT_COUNT, String.valueOf(count));
   }
   request.setTriggerConfiguration(config);
   return this;
 }
コード例 #3
0
 public Builder(ISchedule schedule) {
   request.setToken(schedule.getToken());
   request.setName(schedule.getName());
   request.setTriggerType(schedule.getTriggerType());
   request.setTriggerConfiguration(schedule.getTriggerConfiguration());
   request.setStartDate(schedule.getStartDate());
   request.setEndDate(schedule.getEndDate());
   request.setMetadata(schedule.getMetadata());
 }
コード例 #4
0
 public Builder withEndDate(Date endDate) {
   request.setEndDate(endDate);
   return this;
 }
コード例 #5
0
 public Builder withStartDate(Date startDate) {
   request.setStartDate(startDate);
   return this;
 }
コード例 #6
0
 public Builder(String token, String name) {
   request.setToken(token);
   request.setName(name);
 }