ibi.broker.api.data.schedule
Class TimeInfoMinute

java.lang.Object
  extended by ibi.broker.api.data.schedule.TimeInfo
      extended by ibi.broker.api.data.schedule.TimeInfoMinute
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TimeInfoHour, TimeInfoWeek

public class TimeInfoMinute
extends TimeInfo

 The TimeInfoMinute class represents time information pertaining to scheduled  
 reports that run in intervals of minutes. Like all time-related classes in ReportCaster
 it is derived from the TimeInfo class. 
 A code example illustrating the use of this class is below. It is taken from the samples
 packaged with the product.

 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 +  Copyright (c) 2004 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.       +
 +                                                                          +
 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   

 public class S05_Add_TimeInfo 
{

        public S05_Add_TimeInfo(String[] arg) throws Exception
        {
                //   Example of arg
                //   scheduleDescription car execid execpass
                //   
                //Example of Report source
                //TABLE FILE CAR
                //PRINT CAR WHERE  
                //COUNTRY EQ 'ENGLAND'
                //END
                //
                
                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 TimeInfoMinute
                TimeInfoMinute timeInfo = new TimeInfoMinute();
                GregorianCalendar startTime = new GregorianCalendar();
                timeInfo.setStartTime(startTime);
                GregorianCalendar endTime = new GregorianCalendar();
                endTime.add(Calendar.MINUTE, 15);
                timeInfo.setEndTime(endTime);
                timeInfo.setFrequency(1);
                timeInfo.setMonday(true);
                timeInfo.setTuesday(true);
                timeInfo.setWednesday(true);
                timeInfo.setThursday(true);
                timeInfo.setFriday(true);
                timeInfo.setSaturday(true);
                timeInfo.setSunday(true);
                schedule.setTimeInfo(timeInfo);
                
                //subscribe schedule
                manager.addSchedule(schedule);
        }
        
        
        public static void main(String[] arg)
        {
                S05_Add_TimeInfo sampl = null;
                if(arg.length < 4) {
                         menu();
                         return;
                }
                try
                {
                        System.out.println("\n******* " + S05_Add_TimeInfo.class.getName() + " *****************");
                        sampl = new S05_Add_TimeInfo(arg);
                        System.out.println("\n" + sampl.getClass().getName() + " OK");
                }
                catch(Exception ce)
                {
                        ce.printStackTrace();
                        System.out.println(sampl.getClass().getName() + " FAIL");

                }
        }
        private static void menu()
        {
                System.out.println("Usage: java " + S05_Add_TimeInfo.class.getName() + " <scheduleDescription> <fexFileName> <execId> <execPassword>");
        }
}

 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ibi.broker.api.data.schedule.TimeInfo
CUSTOM, DAY, description, HOUR, id, MINUTE, MONTH, name, ONCE, WEEK, YEAR
 
Constructor Summary
TimeInfoMinute()
           
 
Method Summary
 java.util.Calendar getEndTime()
          Obtains a Java Calendar Object indicating the end time for a ReportCaster schedule.
 int getFrequency()
          Obtains the frequency of a ReportCaster schedule as an integer, in minutes.
 boolean isFriday()
          Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Friday.
 boolean isMonday()
          Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Monday.
 boolean isSaturday()
          Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Saturday.
 boolean isSunday()
          Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Sunday.
 boolean isThursday()
          Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Thursday.
 boolean isTuesday()
          Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Tuesday.
 boolean isWednesday()
          Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Wednesday.
 void setEndTime(java.util.Calendar endTime)
          Assigns a Java Calendar Object indicating the end time for a ReportCaster schedule.
 void setFrequency(int frequency)
          Assigns the frequency for a scheduled event, in minutes.
 void setFriday(boolean friday)
          Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Friday.
 void setMonday(boolean monday)
          Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Monday.
 void setSaturday(boolean saturday)
          Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Saturday.
 void setSunday(boolean sunday)
          Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Sunday.
 void setThursday(boolean thursday)
          Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Thursday.
 void setTuesday(boolean tuesday)
          Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Tuesday.
 void setWednesday(boolean wednesday)
          Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Wednesday.
 
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
 

Constructor Detail

TimeInfoMinute

public TimeInfoMinute()
Method Detail

getEndTime

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

Returns:
a boolean indicating whether the job is scheduled for the end time Calendar object.
See Also:
setEndTime(Calendar)

setEndTime

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

Parameters:
endTime - The end time as a Calendar.
See Also:
getEndTime()

getFrequency

public int getFrequency()
Obtains the frequency of a ReportCaster schedule as an integer, in minutes. For example, if an e-mail report distribution is set to run every five minutes, the frequency would be 5. The default frequency is 1.

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

setFrequency

public void setFrequency(int frequency)
Assigns the frequency for a scheduled event, in minutes. For example, if a email report distribution is set to run every five minutes, the frequency would be 5. The default frequency is 1.

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

isFriday

public boolean isFriday()
Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Friday. If the day is Friday, the value is TRUE. Otherwise it is FALSE.

Returns:
boolean indicating whether the job is scheduled for a Friday.
See Also:
setFriday(boolean)

setFriday

public void setFriday(boolean friday)
Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Friday. If the day is Friday, the value is TRUE. Otherwise it is FALSE.

Parameters:
friday - a boolean indicating whether the job is scheduled for a Friday.
See Also:
isFriday()

isMonday

public boolean isMonday()
Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Monday. If the day is Monday, the value is TRUE. Otherwise it is FALSE.

Returns:
a boolean indicating whether the job is scheduled for a Friday.
See Also:
setFriday(boolean)

setMonday

public void setMonday(boolean monday)
Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Monday. If the day is Monday, the value is TRUE. Otherwise it is FALSE.

Parameters:
monday - a boolean indicating whether the job is scheduled for Monday.
See Also:
isMonday()

isSaturday

public boolean isSaturday()
Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Saturday. If the day is Saturday, the value is TRUE. Otherwise it is FALSE.

Returns:
boolean indicating whether or not the job is scheduled for a Saturday.
See Also:
setSaturday(boolean)

setSaturday

public void setSaturday(boolean saturday)
Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Saturday. If the day is Saturday, the value is TRUE. Otherwise it is FALSE.

Parameters:
saturday - a boolean indicating whether or not the job is scheduled for a Saturday.
See Also:
isSaturday()

isSunday

public boolean isSunday()
Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Sunday. If the day is Sunday, the value is TRUE. Otherwise it is FALSE.

Returns:
a boolean indicating whether the job is scheduled forSunday.
See Also:
setSunday(boolean)

setSunday

public void setSunday(boolean sunday)
Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Sunday. If the day is Sunday, the value is TRUE. Otherwise it is FALSE.

Parameters:
sunday - a boolean indicating whether the job is scheduled for Sunday.
See Also:
isSunday()

isTuesday

public boolean isTuesday()
Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Tuesday. If the day is Tuesday, the value is TRUE. Otherwise it is FALSE.

Returns:
a boolean indicating whether the job is scheduled for Tuesday.
See Also:
setTuesday(boolean)

setTuesday

public void setTuesday(boolean tuesday)
Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Tuesday. If the day is Tuesday, the value is TRUE. Otherwise it is FALSE.

Parameters:
tuesday - a boolean indicating whether the job is scheduled for Tuesday.
See Also:
isTuesday()

isWednesday

public boolean isWednesday()
Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Wednesday. If the day is Wednesday, the value is TRUE. Otherwise it is FALSE.

Returns:
a boolean indicating whether the job is scheduled for Wednesday.
See Also:
setWednesday(boolean)

setWednesday

public void setWednesday(boolean wednesday)
Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Wednesday. If the day is Wednesday, the value is TRUE. Otherwise it is FALSE.

Parameters:
wednesday - a boolean indicating whether the job is scheduled for Wednesday.
See Also:
isWednesday()

isThursday

public boolean isThursday()
Obtains a boolean indicating whether or not the ReportCaster job is scheduled for a Thursday. If the day is Thursday, the value is TRUE. Otherwise it is FALSE.

Returns:
a boolean indicating whether the job is scheduled for Thursday.
See Also:
setThursday(boolean)

setThursday

public void setThursday(boolean thursday)
Assigns a boolean indicating whether or not the ReportCaster job is scheduled for a Thursday. If the day is Thursday, the value is TRUE. Otherwise it is FALSE.

Parameters:
thursday - a boolean indicating whether the job is scheduled for Thursday.
See Also:
isThursday()


Copyright © 2006 Information Builders, Incorporated.