Package com.acelet.lib

Examples of com.acelet.lib.InvalidDataException


      do {
        setNextRunTime(nextRunTime + 40000)

        if (skipTimes++ > 7200
          throw new InvalidDataException(Phrase.get("ER_CONFLICT_BETWEEN_DATA_AND_WEEKEND_POLICY"));
      } while (! new BusinessCalendar().isBusinessDay(nextRunTime, holidaySet));
    }

    if (baseTime > nextRunTime) {
      nextRunTime = NOT_SPECIFIED;
View Full Code Here


    return isAdjustedNextRunTimeValid();
  }

  void setNextRunTime(long baseTime) throws Exception  {
    if (repeating == NOT_SPECIFIED) {
      throw new InvalidDataException(Phrase.get("TX_REPEATING"));

    } if (repeating == REPEATING_ONCE) {
      if (startTime == NOT_SPECIFIED)
        throw new InvalidDataException(Phrase.get("TX_START_TIME"));

      if (startTime >= System.currentTimeMillis())  
        nextRunTime = startTime;
      else
        status = STATUS_INACTIVE; 

    } else if (repeating == REPEATING_MINUTELY) {
      if (startTime == NOT_SPECIFIED)
        throw new InvalidDataException(Phrase.get("TX_START_TIME"));

      if (minutelyPeriod <= 0)
        throw new InvalidDataException(Phrase.get("TX_MINUTELY_PERIOD") + ": " +
          minutelyPeriod);

      setNextRunTimeForMinutely(baseTime, minutelyPeriod);

    } else if (repeating == REPEATING_HOURLY) {
      if (startTime == NOT_SPECIFIED)
        throw new InvalidDataException(Phrase.get("TX_START_TIME"));

      if (hourlyPeriod <= 0)
        throw new InvalidDataException(Phrase.get("TX_HOURLY_PERIOD") + ": " +
          hourlyPeriod);

      setNextRunTimeForMinutely(baseTime, hourlyPeriod * 60);

    } else if (repeating == REPEATING_DAILY) {
      if (startTime == NOT_SPECIFIED)
        throw new InvalidDataException(Phrase.get("TX_START_TIME"));

      if (dailyPeriod <= 0)
        throw new InvalidDataException(Phrase.get("TX_DAILY_PERIOD") + ": " +
          dailyPeriod);

      setNextRunTimeForDaily(baseTime, dailyPeriod);

    } else if (repeating == REPEATING_WEEKLY) {
      if (startTime == NOT_SPECIFIED)
        throw new InvalidDataException(Phrase.get("TX_START_TIME"));

      if (weeklyPeriod <= 0)
        throw new InvalidDataException(Phrase.get("TX_WEEKLY_PERIOD") + ": " + weeklyPeriod);

      if (weeklyWeekDay <= 0)
        throw new InvalidDataException(Phrase.get("TX_WEEKDAY") + ": " + weeklyWeekDay);

      if ((holidayPolicy != HOLIDAY_POLICY_SAME) &&
          (weeklyWeekDay == Calendar.SATURDAY || weeklyWeekDay == Calendar.SUNDAY))
        throw new InvalidDataException(Phrase.get("ER_CONFLICT_BETWEEN_DATA_AND_WEEKEND_POLICY"));

      setNextRunTimeForWeekly(baseTime);

    } else if (repeating == REPEATING_MONTHLY) {
      if (startTime == NOT_SPECIFIED)
        throw new InvalidDataException(Phrase.get("TX_START_TIME"));

      if (monthlyTheDay <= 0)
        throw new InvalidDataException(Phrase.get("TX_MONTHLY_THE_DAY") + ": " + monthlyTheDay);
      if (monthlyPeriod <= 0)
        throw new InvalidDataException(Phrase.get("TX_MONTHLY_PERIOD") + ": " + monthlyTheDay);

      setNextRunTimeForMonthly(baseTime);

    } else if (repeating == REPEATING_WEEK_DAY_MONTHLY) {
      if (startTime == NOT_SPECIFIED)
        throw new InvalidDataException(Phrase.get("TX_START_TIME"));

      if (monthlyPeriod <= 0)
        throw new InvalidDataException(Phrase.get("TX_MONTHLY_PERIOD") + ": " + monthlyTheDay);

      if ((holidayPolicy != HOLIDAY_POLICY_SAME) &&
          (monthlyWhichWeekWeekDay == Calendar.SATURDAY ||
           monthlyWhichWeekWeekDay == Calendar.SUNDAY))
        throw new InvalidDataException(Phrase.get("ER_CONFLICT_BETWEEN_DATA_AND_WEEKEND_POLICY"));

      setNextRunTimeForWeekDayMonthly(baseTime);

    } else if (repeating == REPEATING_AT_SPECIFIED_TIMES) {
      setNextRunTimeForSpecifiedTimes(baseTime);
View Full Code Here

  void setNextRunTimeForSpecifiedTimes(long baseTime) throws Exception {
    GregorianCalendar calendar = getCalculationCalendarForSpecifiedTimes();
    parseSpecifiedTimes();

    if (holidayPolicy != HOLIDAY_POLICY_SAME && specifiedTimesContainWeekendsOnly())
      throw new InvalidDataException(Phrase.get("ER_CONFLICT_BETWEEN_DATA_AND_WEEKEND_POLICY"));

    int firstEligibleHour = getFirstEligibleHourForSpecifiedTime();
    int firstEligibleMinute = getFirstEligibleMinuteForSpecifiedTime();

    int startMonth = calendar.get(Calendar.MONTH);
View Full Code Here

TOP

Related Classes of com.acelet.lib.InvalidDataException

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.