Package org.quartz

Examples of org.quartz.NthIncludedDayTrigger


        try
        {
          String calendarName = nextUniqueName();
          scheduler.addCalendar(calendarName, nthBusinessDaySchedule.getNthBusinessDay().getHolidayCalendar(), false, false);
         
          NthIncludedDayTrigger trigger = new NthIncludedDayTrigger (triggerName, null);
          trigger.setN(nthBusinessDaySchedule.getNthBusinessDay().getN());
          trigger.setFireAtTime(nthBusinessDaySchedule.getNthBusinessDay().getFireAtTime());
          trigger.setEndTime(nthBusinessDaySchedule.getFinalExpiration());
          trigger.setCalendarName(calendarName);


          switch(nthBusinessDaySchedule.getNthBusinessDay().getInterval()) {
            case WEEKLY:  
              trigger.setIntervalType(NthIncludedDayTrigger.INTERVAL_TYPE_WEEKLY);
              break;
            case MONTHLY:
              trigger.setIntervalType(NthIncludedDayTrigger.INTERVAL_TYPE_MONTHLY);
              break;
            case YEARLY:
              trigger.setIntervalType(NthIncludedDayTrigger.INTERVAL_TYPE_YEARLY);
              break;
          }

          if ( nthBusinessDaySchedule.getExpiration()!=null )
          {
            trigger.setStartTime (nthBusinessDaySchedule.getExpiration());
          }
          else if ( nthBusinessDaySchedule.getDuration()!=null )
          {
            trigger.setStartTime (calculateDelayedDate(nthBusinessDaySchedule.getDuration()));
          }

          scheduler.scheduleJob( jobDetail, trigger );

        }
View Full Code Here

TOP

Related Classes of org.quartz.NthIncludedDayTrigger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.