|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.data.schedule.Schedule
public class Schedule
Encapsulates the process of scheduling reports for distribution by ReportCaster.
Each schedule object is represented by a unique identifier called a scheduleID and is comprised of
objects including Destination, Distribution, TimeInfo and Task.
These represent the components of the schedule.
The code example below shows an implementation of the Schedule
class.
It is taken from the coding samples packaged with the product in the samples directory.
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 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 S02_Add_Email { public S02_Add_Email(String[] arg) throws Exception { // Example of arg // scheduleDescription car execid execpass xxx@ibi.com // //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]; String emailAddress = arg[4]; // 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); //create destination Destination destination = new Destination(); destination.setType(Destination.SINGLE_ADDRESS); destination.setSingleAddress(emailAddress); //set distribution to email - not absolutely necessary using a default schedule instance DistributionEmail distribution = (DistributionEmail)schedule.getDistribution(); distribution.setDestination(destination); distribution.setInlineMessage("inLineMessage"); distribution.setInlineTaskIndex(0); distribution.setMailFrom("mailFrom"); distribution.setMailReplyAddress("mailReplyAddress"); distribution.setMailServerName("mailserver"); distribution.setMailSubject("subject"); schedule.setDistribution(distribution); //create task TaskWFServerProcedure task = new TaskWFServerProcedure(); task.setProcedureName(fexFileName); task.setReportName("Report for " + fexFileName); task.setExecId(execId); task.setExecPassword(execPassword); schedule.setTaskList(new Task[]{task}); //subscribe schedule manager.addSchedule(schedule); } public static void main(String[] arg) { S02_Add_Email sampl = null; if(arg.length < 5) { menu(); return; } try { System.out.println("\n******* " + S02_Add_Email.class.getName() + " *****************"); sampl = new S02_Add_Email(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 " + S02_Add_Email.class.getName() + " <scheduleDescription> <fexFileName> <execId> <execPassword> <emailAddress>"); } }
Field Summary | |
---|---|
static int |
TRACE_DEFAULT
|
static int |
TRACE_NONE
|
static int |
TRACE_SCHEDULE
|
static int |
TRACE_SCHEDULE_AND_REPORT
|
Constructor Summary | |
---|---|
Schedule()
|
Method Summary | |
---|---|
java.lang.String |
getDescription()
Obtains the text describing the job that is being scheduled. |
Distribution |
getDistribution()
Obtains the Distribution object associated with this Schedule. |
Task |
getFirstTask()
|
java.lang.String |
getId()
Obtains the unique identifier to this schedule, also known as a scheduleID. |
java.util.Calendar |
getLastTimeExecuted()
|
Notification |
getNotification()
Obtains an instance of the Notification object associated with this Schedule. |
java.lang.String |
getOwner()
Obtains the ReportCaster owner of this schedule, which is a ReportCaster userid. |
int |
getPriority()
Obtains the priority level for the scheduled job. |
java.lang.String |
getStatusLastExecuted()
|
Task[] |
getTaskList()
Obtains an array of Task objects, with each Task object containing one report to be distributed as part of this schedule. |
TimeInfo |
getTimeInfo()
Obtains the TimeInfo object associated with this schedule, which contains the frequency and time parameters indicating when and how often this schedule should run. |
int |
getTraceType()
Returns the trace type setting, as an integer. |
boolean |
isActive()
Obtains the state of the boolean flag indicating whether or not a scheduled distribution is active. |
boolean |
isCompressedReport()
Returns the value of the compressedReport property. |
boolean |
isDeleteJobAfterRun()
Obtains the state of the boolean flag indicating whether or not a schedule is deleted after running the job. |
void |
setActive(boolean active)
Assigns the boolean flag indicating whether or not a scheduled distribution is active. |
void |
setCompressedReport(boolean b)
Sets the value of the compressedReport property. |
void |
setDeleteJobAfterRun(boolean deleteJobAfterRun)
Assigns a boolean flag indicating whether or not a schedule is deleted after running the job. |
void |
setDescription(java.lang.String description)
Assigns the text describing the job that is being scheduled. |
void |
setDistribution(Distribution distribution)
Assigns the Distribution object associated with this Schedule. |
void |
setFirstTask(Task task)
|
void |
setId(java.lang.String id)
Assigns a unique identifier to this schedule. |
void |
setLastTimeExecuted(java.util.Calendar lastTimeExecuted)
|
void |
setNotification(Notification notification)
Specifies the Notification object associated with this Schedule. |
void |
setOwner(java.lang.String owner)
Assigns the owner of this schedule. |
void |
setPriority(int priority)
Assigns the priority level for the scheduled job. |
void |
setStatusLastExecuted(java.lang.String statusLastExecuted)
|
void |
setTaskList(Task[] taskList)
Assigns an array of Task objects, with each Task object containing one report that is to be distributed as part of this schedule. |
void |
setTimeInfo(TimeInfo timeInfo)
Assigns the TimeInfo object associated to this schedule, which contains the frequency and time parameters indicating when and how often this schedule should run. |
void |
setTraceType(int traceType)
Assigns the trace type setting, as an integer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TRACE_DEFAULT
public static final int TRACE_NONE
public static final int TRACE_SCHEDULE
public static final int TRACE_SCHEDULE_AND_REPORT
Constructor Detail |
---|
public Schedule()
Method Detail |
---|
public boolean isActive()
setActive(boolean)
public void setActive(boolean active)
active
- Whether schedule active or not.isActive()
public int getTraceType()
setTraceType(int)
public void setTraceType(int traceType)
traceType
- The trace type setting, as an integer.getTraceType()
public boolean isDeleteJobAfterRun()
setDeleteJobAfterRun(boolean)
public void setDeleteJobAfterRun(boolean deleteJobAfterRun)
deleteJobAfterRun
- The deleteJobAfterRun to set.isDeleteJobAfterRun()
public java.lang.String getDescription()
setDescription(String)
public void setDescription(java.lang.String description)
description
- The description to set.getDescription()
public Distribution getDistribution()
setDistribution(Distribution)
,
Distribution
public void setDistribution(Distribution distribution)
distribution
- The reference to the distribution to set.getDistribution()
public java.lang.String getId()
setId(String)
public void setId(java.lang.String id)
id
- The id to set.getId()
public Notification getNotification()
setNotification(Notification)
public void setNotification(Notification notification)
notification
- The notification to set.getNotification()
public java.lang.String getOwner()
setOwner(String)
public void setOwner(java.lang.String owner)
owner
- The owner as a String.getOwner()
public int getPriority()
setPriority(int)
public void setPriority(int priority)
priority
- The priority to set.getPriority()
public Task[] getTaskList()
setTaskList(Task[])
,
Task
public void setTaskList(Task[] taskList)
taskList
- The taskList to set.getTaskList()
,
Task
public TimeInfo getTimeInfo()
setTimeInfo(TimeInfo)
,
TimeInfo
public void setTimeInfo(TimeInfo timeInfo)
timeInfo
- The reference to the timeInfo object.getTimeInfo()
,
TimeInfo
public boolean isCompressedReport()
public void setCompressedReport(boolean b)
b
- compressedReport The compressedReport to set.public Task getFirstTask()
public void setFirstTask(Task task)
public java.util.Calendar getLastTimeExecuted()
public void setLastTimeExecuted(java.util.Calendar lastTimeExecuted)
public java.lang.String getStatusLastExecuted()
public void setStatusLastExecuted(java.lang.String statusLastExecuted)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |