i-net Clear Reports

com.inet.report.schedule
Class MonthlyExecution

java.lang.Object
  extended by com.inet.report.schedule.ScheduleExecution
      extended by com.inet.report.schedule.MonthlyExecution
All Implemented Interfaces:
ExecutionTimeProvider

public class MonthlyExecution
extends ScheduleExecution

An ExecutionTimeProvider which would be described in the form "Run the task in the months ___, ___, and ___ on days _____, ____, and ____ at ____ o'clock." To create a MonthlyExecution object, use createMonthlyExecution from the class ScheduleExecutionFactory.
Once created, you can set the specific months and the specific days of the month in addition to changing time of day and hour range, methods in the super class ScheduleExecution.

Since:
6.0
See Also:
OneDayExecution, DailyExecution, WeeklyExecution, ScheduleExecutionFactory, ScheduleExecution, ExecutionTimeProvider

Nested Class Summary
 
Nested classes/interfaces inherited from class com.inet.report.schedule.ScheduleExecution
ScheduleExecution.WeekDay, ScheduleExecution.WeekIndex
 
Constructor Summary
protected MonthlyExecution(java.util.Date date, int hour, int minute)
          Construct a MonthlyExecution.
 
Method Summary
 int getMonthStepSize()
          Returns the month step size as an int.
 int[] getSpecificDays()
          Returns the specific days of the month to execute the task on.
 int[] getSpecificMonths()
          Returns the specific months the task is to be executed during.
 ScheduleExecution.WeekDay getWeekDay()
          Returns the WeekDay or null.
 ScheduleExecution.WeekIndex getWeekIndex()
          Returns the WeekIndex or null.
 int getYearStepSize()
          Returns the year step size as an int.
 void setMonthStepSize(int monthStepSize)
          Sets the month step size for this execution time provider - the value must be 1 or greater.
 void setSpecificDays(int[] specificDays)
          Sets the specific days of the month the task is to be executed on in the chosen months. 1-based, maximum is 31.
 void setSpecificMonths(int[] specificMonths)
          Sets the specific months the task is to be executed during.
 void setWeekDay(ScheduleExecution.WeekIndex weekIndex, ScheduleExecution.WeekDay weekDay)
          Set the WeekDay and WeekIndex Parameter.
 void setYearStepSize(int yearStepSize)
          Sets the year step size for this execution time provider - the value must be 1 or greater.
 
Methods inherited from class com.inet.report.schedule.ScheduleExecution
getEndDate, getHour, getHourRange, getLoopCount, getMinute, getNextExecutionTime, getStartDate, setEndDate, setHourRange, setHourRange, setLoopCount, setStartDate, setStartTime
 

Constructor Detail

MonthlyExecution

protected MonthlyExecution(java.util.Date date,
                           int hour,
                           int minute)
Construct a MonthlyExecution. Use the ScheduleExecutionFactory instead. Creates a ScheduleExecution object of the type MonthlyExecution with a specified start date, month steps, days of the month, and start time.

Example: "Every second month, on the 2nd and 5th of the month, starting on April 25th, 2005, at 10:13 a.m."
createMonthlyExecution(new Date(105,3,25),new int[]{2,5},2,10,13,null,null);
You can also create a ScheduleExecution object of the type MonthlyExecution with a specified start date, month steps, start time, and with a ScheduleExecution.WeekIndex and ScheduleExecution.WeekDay.

Example: "Every month, on the second Monday of the month, starting on April 25th, 2005, at 10:13 a.m."
createMonthlyExecution(new Date(105,3,25),null,1,10,13,WeekIndex.SECOND,WeekDay.MONDAY);

Parameters:
date - The date (NOT to be mistaken for the point in time - the only thing that counts in the date object is the actual day - setting a Date
hour - The hour of day the task is to be run on - must be between 0 and 23
minute - The minute of the hour the task is to be run on - must be between 0 and 59
Since:
12.0
Method Detail

setMonthStepSize

public void setMonthStepSize(int monthStepSize)
                      throws ScheduleException
Sets the month step size for this execution time provider - the value must be 1 or greater.

Parameters:
monthStepSize - The month step size for this execution time provider
Throws:
ScheduleException - If the monthStepSize is less than 1.
Since:
12.0

setWeekDay

public void setWeekDay(ScheduleExecution.WeekIndex weekIndex,
                       ScheduleExecution.WeekDay weekDay)
Set the WeekDay and WeekIndex Parameter. For Example: setWeekDay(WeekIndex.LAST,WeekDay.DAY);

Parameters:
weekIndex - the week index parameter: first, second, third, fourth or last
weekDay - the week day parameter: Monday, Tuesday, ... or day
Since:
12.0

setYearStepSize

public void setYearStepSize(int yearStepSize)
                     throws ScheduleException
Sets the year step size for this execution time provider - the value must be 1 or greater.

Parameters:
yearStepSize - The year step size for this execution time provider
Throws:
ScheduleException - If the yearStepSize is less than 1.
Since:
12.0

getYearStepSize

public int getYearStepSize()
Returns the year step size as an int.

Returns:
The year step size of the task.
Since:
12.0

getMonthStepSize

public int getMonthStepSize()
Returns the month step size as an int.

Returns:
The month step size of the task.
Since:
12.0

setSpecificMonths

public void setSpecificMonths(int[] specificMonths)
                       throws ScheduleException
Sets the specific months the task is to be executed during. One-based starting in January.
E.g. "January, July, August, and December" would be the int array {1,7,8,12}.

Parameters:
specificMonths - The specific months to execute the task during.
Throws:
ScheduleException - If the array is null or empty or if one of the months is not between 1 and 12.

getSpecificMonths

public int[] getSpecificMonths()
Returns the specific months the task is to be executed during.

Returns:
The specific months the task is to be executed during.

setSpecificDays

public void setSpecificDays(int[] specificDays)
                     throws ScheduleException
Sets the specific days of the month the task is to be executed on in the chosen months. 1-based, maximum is 31. If a certain day does not exist in one of the chosen months, it will be ignored for that month only.
E.g. if we have set months March, April, and July, and the days {20,31}, only dates March 20th, March 31st, April 20th, July 20th, and July 31st will be selected.

Parameters:
specificDays - The specific days of the month the task is to be executed on in the chosen months.
Throws:
ScheduleException - If the array is null or empty or if one of the days is not between 1 and 31.

getSpecificDays

public int[] getSpecificDays()
Returns the specific days of the month to execute the task on.

Returns:
The specific days of the month to execute the task on.

getWeekDay

public ScheduleExecution.WeekDay getWeekDay()
Returns the WeekDay or null.

Returns:
the current WeekDay.
Since:
12.0

getWeekIndex

public ScheduleExecution.WeekIndex getWeekIndex()
Returns the WeekIndex or null.

Returns:
the current WeekIndex.
Since:
12.0

i-net Clear Reports

Copyright © 1999-2015 by i-net software GmbH