ibi.broker.api.data.schedule
Class TimeInfoMonth

java.lang.Object
  extended by ibi.broker.api.data.schedule.TimeInfo
      extended by ibi.broker.api.data.schedule.TimeInfoMonth
All Implemented Interfaces:
java.io.Serializable

public class TimeInfoMonth
extends TimeInfo

 
 The TimeInfoMonth class represents time information pertaining to scheduled  
 reports that run in intervals of months. Like all time-related classes in ReportCaster
 it is ultimately derived from the TimeInfo class. 
 The code snippet below illustrates the use of this class:

 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 +  Copyright (c) 2006 Information Builders, Inc. All  Rights Reserved.      +
 +                                                                          +
 +  Information Builders offers sample API programs as a heuristic device.  +
 +  They are not intended, as is, for production use. Licensed users are    +
 +  welcome to alter and extend these samples and deploy them in other      +
 +  environments, or alternate configurations, as they see fit.             +
 +  Information Builders will support the documented functionality of       +
 +  its API classes and methods. However, Information Builders is not       +
 +  responsible for functionality or behavior of products built with        +
 +  its API unless the documented behavior of its discrete classes and      +
 +  methods is different than the actual results.                           +
 +                                                                          +
 +  Redistributions of IBI source code and documentation must be within     +
 +  the scope of the Information Builders Software License Agreement.       +
 +                                                                          +
 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   

  String scheduleDescription = arg[0];
        String fexFileName = arg[1];
        String execId = arg[2];
        String execPassword = arg[3];
        
        // Create ScheduleManager
        ScheduleManager manager = Util.createCasterConnection().getScheduleManager();
        
        //create object schedule with default values from config file
        Schedule schedule = manager.createScheduleInstanceDefault();
        
        //set description
        schedule.setDescription(scheduleDescription);
        
        //set distribution to library
        Distribution distribution = new StorageLibrary();
        schedule.setDistribution(distribution);
        
        //create task
        TaskWFServerProcedure task = new TaskWFServerProcedure();
        task.setProcedureName(fexFileName);
        task.setExecId(execId);
        task.setExecPassword(execPassword);
        schedule.setTaskList(new Task[]{task});
        
        //create TimeInfoMonth
        TimeInfoMonth timeInfo = new TimeInfoMonth();
        GregorianCalendar startTime = new GregorianCalendar();
        timeInfo.setStartTime(startTime);
        GregorianCalendar endTime = new GregorianCalendar();
        endTime.add(Calendar.MONTH, 4);
        timeInfo.setEndTime(endTime);
        timeInfo.setFrequency(1);
        boolean[] days = new boolean[]
            {false, true, false, true, false, true, false,
                                        false, true, false, true, false, true, false,
                                        false, true, false, true, false, true, false,
                                        false, true, false, true, false, true, false,
                                        false, false, false,};
        timeInfo.setDaysOfMonth(days);
        timeInfo.setLastDayOfMonth(true);
        schedule.setTimeInfo(timeInfo);
        
        //subscribe schedule
        manager.addSchedule(schedule);
 

See Also:
Serialized Form

Field Summary
static int LAST_WEEK_OF_MONTH
           
 
Fields inherited from class ibi.broker.api.data.schedule.TimeInfo
CUSTOM, DAY, description, HOUR, id, MINUTE, MONTH, name, ONCE, WEEK, YEAR
 
Constructor Summary
TimeInfoMonth()
           
 
Method Summary
 int getDayOfWeek()
           
 boolean[] getDaysOfMonth()
          Obtains a 31 element array of booleans indicating which days of the month have been selected for a report to run.
 java.util.Calendar getEndTime()
          Obtains a Java Calendar Object indicating the end time for the schedule associated with the this TimeInfoMonth instance.
 int getFrequency()
          Obtains the frequency for a scheduled distribution.
 TimeInterval getSecondaryRunInterval()
           
 int getWeekOfMonth()
           
 boolean isDayOfWeekEnabled()
           
 boolean isLastDayOfMonth()
          Obtains a boolean indicating whether or not the last day of the month flag is set.
 void setDayOfWeek(int dayOfWeek)
           
 void setDayOfWeekEnabled(boolean dayOfWeekEnabled)
           
 void setDaysOfMonth(boolean[] daysOfMonth)
          Assigns a 31 element array of booleans indicating which days of the month have been selected for a report to run.
 void setEndTime(java.util.Calendar endTime)
          Assigns a Java Calendar Object indicating the end time for the schedule associated with this TimeInfoMonth instance.
 void setFrequency(int frequency)
          Assigns the frequency for a scheduled distribution.
 void setLastDayOfMonth(boolean lastDayOfMonth)
          Assigns a boolean indicating whether or not the last day of the month flag is set.
 void setSecondaryRunInterval(TimeInterval secondaryRunInterval)
           
 void setWeekOfMonth(int weekOfMonth)
           
 
Methods inherited from class ibi.broker.api.data.schedule.TimeInfo
getDescription, getId, getName, getNextRunTime, getStartTime, setDescription, setId, setName, setNextRunTime, setStartTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_WEEK_OF_MONTH

public static final int LAST_WEEK_OF_MONTH
See Also:
Constant Field Values
Constructor Detail

TimeInfoMonth

public TimeInfoMonth()
Method Detail

getDaysOfMonth

public boolean[] getDaysOfMonth()
Obtains a 31 element array of booleans indicating which days of the month have been selected for a report to run. All array members are initialized to FALSE. Those members of the array that are then set to true are the days of the month the schedule will run.

Returns:
The days of the month as an Array of booleans.
See Also:
setDaysOfMonth(boolean[] daysOfMonth)

setDaysOfMonth

public void setDaysOfMonth(boolean[] daysOfMonth)
Assigns a 31 element array of booleans indicating which days of the month have been selected for a report to run. All array members are initialized to FALSE. Those members of the array that are then set to true are the days of the month the schedule will run.

Parameters:
daysOfMonth - An array of booleans representing the days of the month.
See Also:
getDaysOfMonth()

getEndTime

public java.util.Calendar getEndTime()
Obtains a Java Calendar Object indicating the end time for the schedule associated with the this TimeInfoMonth instance. As the Java Calendar class is an abstract class, the actual instance object involved is a GregorianCalendar. The default end time is 2099.

Returns:
A reference to the end time Calendar object.
See Also:
setEndTime(Calendar endTime)

setEndTime

public void setEndTime(java.util.Calendar endTime)
Assigns a Java Calendar Object indicating the end time for the schedule associated with this TimeInfoMonth instance. As the Java Calendar class is an abstract class, the actual instance object involved is a GregorianCalendar. The default end time is 2099.

Parameters:
endTime - A Calendar object representing the schedule's end time.
See Also:
getEndTime()

getFrequency

public int getFrequency()
Obtains the frequency for a scheduled distribution. For example if an email report distribution is set to run every six months, the frequency is 6. ReportCaster uses standard Java data arithmetic to determine run dates when adding months to a start date. The default frequency is 1.

Returns:
The frequency as an integer.
See Also:
setFrequency(int frequency)

setFrequency

public void setFrequency(int frequency)
Assigns the frequency for a scheduled distribution. For example if an email report distribution is set to run every six months, the frequency is 6. ReportCaster uses standard Java data arithmetic to determine run dates when adding months to a start date. The default frequency is 1.

Parameters:
frequency - An integer representing the frequency.
See Also:
getFrequency()

isLastDayOfMonth

public boolean isLastDayOfMonth()
Obtains a boolean indicating whether or not the last day of the month flag is set. When this flag is set, ReportCaster runs a schedule on the last day of the month regardless of what day it is. For example, a schedule set to run on February 28th will next run on March 31st if this flag is set. Otherwise, ReportCaster will run the job on the corresponding day of the next month. If this flag isn't set then it will run the report on March 28th. If the corresponding day of the next month doesn't exist, then ReportCaster will not run the report.

Returns:
A boolean indicating if a day is the last day of the month.
See Also:
setLastDayOfMonth(boolean lastDayOfMonth)

setLastDayOfMonth

public void setLastDayOfMonth(boolean lastDayOfMonth)
Assigns a boolean indicating whether or not the last day of the month flag is set. When this flag is set, ReportCaster runs a schedule on the last day of the month regardless of what day it is. For example, a schedule set to run on February 28th will next run on March 31st if this flag is set. Otherwise, ReportCaster will run the job on the corresponding day of the next month. If this flag isn't set then it will run the report on March 28th. If the corresponding day of the next month doesn't exist, then ReportCaster will not run the report.

Parameters:
lastDayOfMonth - The lastDayOfMonth to set.
See Also:
isLastDayOfMonth()

getSecondaryRunInterval

public TimeInterval getSecondaryRunInterval()

setSecondaryRunInterval

public void setSecondaryRunInterval(TimeInterval secondaryRunInterval)

getDayOfWeek

public int getDayOfWeek()
Returns:
Returns the dayOfWeek.

setDayOfWeek

public void setDayOfWeek(int dayOfWeek)
Parameters:
dayOfWeek - The dayOfWeek to set.

isDayOfWeekEnabled

public boolean isDayOfWeekEnabled()
Returns:
Returns the dayOfWeekEnabled.

setDayOfWeekEnabled

public void setDayOfWeekEnabled(boolean dayOfWeekEnabled)
Parameters:
dayOfWeekEnabled - The dayOfWeekEnabled to set.

getWeekOfMonth

public int getWeekOfMonth()
Returns:
Returns the weekOfMonth .

setWeekOfMonth

public void setWeekOfMonth(int weekOfMonth)
Parameters:
weekOfMonth - The weekOfMonth to set.


Copyright © 2006 Information Builders, Incorporated.