ibi.broker.api.cci
Interface ScheduleManager

All Known Implementing Classes:
ScheduleManagerClientSF

public interface ScheduleManager

ScheduleManager This interface provides a means of managing
 schedules within ReportCaster. Through this interface, Schedule 
 objects can be created and stored directly in the ReportCaster repository then sent to 
 the Distribution Server, where the schedule can run. Once in the repository, basic
 operations such as updating and deleting the schedule can be performed. Moreover an 
 existing schedule can be interrogated in order to determine certain properties such as 
 who the owners are, and what the specific Amper Parameters are which may be
 associated with a specified scheduled Task.
 The code below shows the instantiation of a ScheduleManager object
 using the default implementation of the ScheduleManager interface. 

 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      
 +  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.       +      
 +                                                                          +      
 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      


 CasterManagedConnectionFactory managedConnectionFactory = new CasterManagedConnectionFactory();
 managedConnectionFactory.setServerName(host);//the name of the server running the distribution server
 managedConnectionFactory.setPortNumber(port);//the port the distribution server is listening
 CasterConnectionFactory connectionFactory = (CasterConnectionFactory)managedConnectionFactory.createConnectionFactory();
 ConnectionSpec credential = new PasswordCredential(user, password.toCharArray());
    //This can be any of the credential objects. It is assumed here the user String has been assigned earlier
   // and that password, also assigned earlier, is a String that needs to be converted to a character Array.
 CasterConnection connectionObject = ((CasterConnection)connectionFactory.getConnection(credential));
 ScheduleManager manager = connectionObject.getScheduleManager();
 

Version:
5.3

Method Summary
 java.lang.String addSchedule(Schedule schedule)
          Takes a Schedule object and adds it to the ReportCaster repository.
 Schedule createScheduleInstance(int intervalType, java.lang.String distributionType, int taskType)
          Creates a new Schedule object with specified integer constant values for IntervalType, distributionType, and taskType.
 Schedule createScheduleInstanceDefault()
          Creates a new Schedule object with default schedule property values.
 void deleteSchedule(java.lang.String scheduleId)
          Deletes the schedule as identified by its unique schedule identifier from the ReportCaster repository.
 AmperParameter[] getAmperParameterList(Task task)
          Deprecated. 
 AmperParameter[] getAmperParameterList(Task task, java.lang.String owner)
          Obtains an Array of AmperParameter objects that are associated with a scheduled task.
 java.lang.String[] getOwnerList()
          Retrieves a String Array representing the list of schedule owners from ReportCaster repository.
 Schedule getSchedule(java.lang.String scheduleId)
          Retrieves an existing schedule from the ReportCaster repository based on a given schedule identifier.
 java.lang.String getScheduleId(java.lang.String owner, java.lang.String scheduleDescription)
          Retrieves the unique schedule identifier from the ReportCaster repository based on specifying the schedule description (see Schedule.getDescription()) and owner.
 Schedule[] getScheduleInfoList(java.lang.String[] scheduleId)
           
 Schedule[] getScheduleInfoList(java.lang.String owner, java.lang.String method, java.lang.String priority, java.lang.String active, java.util.Calendar startDate, java.util.Calendar endDate)
           
 Schedule[] getScheduleInfoListByCaller()
          Retrieves an array of Schedule objects from the ReportCaster repository that are owned by the current logon user (or API caller).
 Schedule[] getScheduleInfoListByOwner(java.lang.String owner)
          Retrieves an array of Schedule objects from the ReportCaster repository that belong to a specified owner.
 Schedule[] getScheduleList(java.lang.String[] scheduleId)
           
 java.lang.String run(Schedule schedule)
          After a Schedule object has been created and its properties populated with data, this method immediately submits the schedule to the ReportCaster Distribution Server, which runs the schedule.
 java.lang.String run(Schedule schedule, JobOptions jobOptions)
          After a Schedule object has been created and its properties populated with data, this method immediately submits the schedule to the ReportCaster Distribution Server with a JobListener class name, which runs the schedule.
 java.lang.String run(java.lang.String[] idList, JobOptions jobOptions)
           
 void updateSchedule(Schedule schedule)
          Updates a Schedule object which already exists in the ReportCaster repository.
 

Method Detail

getSchedule

Schedule getSchedule(java.lang.String scheduleId)
                     throws CasterException
Retrieves an existing schedule from the ReportCaster repository based on a given schedule identifier. The schedule Id uniquely identifies a schedule and can be used to retrieve all schedule data including any information pertaining to tasks associated with the schedule. This method is available to the administrator and the schedule owner only.

Parameters:
scheduleId - Id that uniquely identifies the schedule in the repository.
Returns:
A Schedule object.
Throws:
CasterException

getScheduleInfoListByCaller

Schedule[] getScheduleInfoListByCaller()
                                       throws CasterException
Retrieves an array of Schedule objects from the ReportCaster repository that are owned by the current logon user (or API caller). Because this is designed just to retrieve information for each schedule, for performance reasons, each schedule object has all its properties populated with data with the exception of the task information, which are all NULL (see Schedule.getTaskList()). An administrator will receive all schedules, end user will receive only those schedules owned by him.

Returns:
An array of Schedule objects.
Throws:
CasterException

getScheduleInfoListByOwner

Schedule[] getScheduleInfoListByOwner(java.lang.String owner)
                                      throws CasterException
Retrieves an array of Schedule objects from the ReportCaster repository that belong to a specified owner. If the API caller is admin, any owner can be specified. If the caller is an enduser, the owner must be the caller itself. Otherwise, an Exception will be thrown during the permission check. Because this is designed just to retrieve information for each schedule, for performnce reasons,Each schedule object has all its properties populated with data with the exception of the task information, which are all NULL (see Schedule.getTaskList()). This method is available to the administrator and the schedule owner only. An administrator will receive all schedules, an end user will receive only those schedules owned by him.

Parameters:
owner - The schedule owner's username.
Returns:
An array of Schedule objects.
Throws:
CasterException

getScheduleInfoList

Schedule[] getScheduleInfoList(java.lang.String owner,
                               java.lang.String method,
                               java.lang.String priority,
                               java.lang.String active,
                               java.util.Calendar startDate,
                               java.util.Calendar endDate)
                               throws CasterException
Throws:
CasterException

getScheduleInfoList

Schedule[] getScheduleInfoList(java.lang.String[] scheduleId)
                               throws CasterException
Throws:
CasterException

getScheduleList

Schedule[] getScheduleList(java.lang.String[] scheduleId)
                           throws CasterException
Throws:
CasterException

addSchedule

java.lang.String addSchedule(Schedule schedule)
                             throws CasterException
Takes a Schedule object and adds it to the ReportCaster repository. The schedule object may have been created in any of several ways (for example by using the Schedule object's Constructor or one of ScheduleManager's createScheduleInstance methods). The object itself exists in memory, but does not actually exist in the repository until this method is called. Once the schedule is added to the repository, the newly generated scheduleId (same Id as returned by Schedule.getId()), which uniquely identifies this Schedule>/code> object in the ReportCaster repository, is returned to the caller. This method is available to the administrator and the schedule owner only.

Parameters:
schedule - A Schedule object encapsulating the new Schedule object.
Returns:
A newly generated schedule identifier or scheduleId.
Throws:
CasterException

updateSchedule

void updateSchedule(Schedule schedule)
                    throws CasterException
Updates a Schedule object which already exists in the ReportCaster repository. Before modifying the schedule, ReportCaster checks the scheduleId (see Schedule.getId()) to determine if this schedule object, as identified by its unique Id, is already in the repository/database. If it is, the caller can modify the properties. If it is not already in the database, an exception is thrown (see CasterException below). This method is available to the administrator and the schedule owner only.

Parameters:
schedule - A Schedule object encapsulating the existing Schedule.
Throws:
CasterException - The msgId for the Exception thrown if the scheduleId is not in the database is "SCH001".

deleteSchedule

void deleteSchedule(java.lang.String scheduleId)
                    throws CasterException
Deletes the schedule as identified by its unique schedule identifier from the ReportCaster repository. This method is available to the administrator and the schedule owner only.

Parameters:
scheduleId - Id that uniquely identifies the schedule in the repository.
Throws:
CasterException

getOwnerList

java.lang.String[] getOwnerList()
                                throws CasterException
Retrieves a String Array representing the list of schedule owners from ReportCaster repository. The owner list contains the user names of individuals who have created schedules or have the right to create schedules in ReportCaster. Only the schedule admin user can call this method.

Returns:
A String Array of schedule owners.
Throws:
CasterException

run

java.lang.String run(Schedule schedule)
                     throws CasterException
After a Schedule object has been created and its properties populated with data, this method immediately submits the schedule to the ReportCaster Distribution Server, which runs the schedule. When the schedule runs, the Distribution Server creates a unique job number or jobId for this schedule, which is returned to the caller upon the completion/execution of the job. This method is available to the administrator and the schedule owner only.

Parameters:
schedule - A Schedule object encapsulating the job that is to be run.
Returns:
A job number generated by the Distribution Server.
Throws:
CasterException

run

java.lang.String run(Schedule schedule,
                     JobOptions jobOptions)
                     throws CasterException
After a Schedule object has been created and its properties populated with data, this method immediately submits the schedule to the ReportCaster Distribution Server with a JobListener class name, which runs the schedule. When the schedule runs, the Distribution Server creates a unique job number or jobId for this schedule, which is returned to the caller upon the completion/execution of the job. This method is available to the administrator and the schedule owner only.

Parameters:
schedule - A Schedule object encapsulating the job that is to be run.
Returns:
A job number generated by the Distribution Server.
Throws:
CasterException

run

java.lang.String run(java.lang.String[] idList,
                     JobOptions jobOptions)
                     throws CasterException
Throws:
CasterException

getAmperParameterList

@Deprecated
AmperParameter[] getAmperParameterList(Task task)
                                       throws CasterException
Deprecated. 

Obtains an Array of AmperParameter objects that are associated with a scheduled task. The only task types for which Amper Parameters are meaningful are Standard Report and My Report (i.e, applying to reports that exist within Managed Reporting or MRE). See AmperParameter for more information. This method is available to the administrator and the schedule owner only.

Parameters:
task - The Task object containing the Amper variables that get encapsulated in Array of AmperParameter objects..
Returns:
An array of AmperParameter objects.
Throws:
CasterException
See Also:
AmperParameter

getAmperParameterList

AmperParameter[] getAmperParameterList(Task task,
                                       java.lang.String owner)
                                       throws CasterException
Obtains an Array of AmperParameter objects that are associated with a scheduled task. The only task types for which Amper Parameters are meaningful are Standard Report and My Report (i.e, applying to reports that exist within Managed Reporting or MRE). See AmperParameter for more information. This method is available to the administrator and the schedule owner only.

Parameters:
task - The Task object containing the Amper variables that get encapsulated in Array of AmperParameter objects..
owner - The username of the schedule owner
Returns:
An array of AmperParameter objects.
Throws:
CasterException
See Also:
AmperParameter

getScheduleId

java.lang.String getScheduleId(java.lang.String owner,
                               java.lang.String scheduleDescription)
                               throws CasterException
Retrieves the unique schedule identifier from the ReportCaster repository based on specifying the schedule description (see Schedule.getDescription()) and owner. If the API caller is admin, any owner can be specified. If the caller is an enduser, the owner must be the caller itself. Otherwise, an Exception will be thrown during the permission check.

Parameters:
owner - The username of the schedule owner
scheduleDescription - The description of the schedule (see Schedule.getDescription()). Note that maximum field length is 90 characters
Returns:
A unique schedule id as a String
Throws:
CasterException

createScheduleInstanceDefault

Schedule createScheduleInstanceDefault()
                                       throws CasterException
Creates a new Schedule object with default schedule property values. The default values are: intervalType = ONCE, distributionType = MAIL, and taskType = WEBFOCUS_SERVER_PROCEDURE,priority = 3, and notification is off.

Returns:
A new Schedule object.
Throws:
CasterException

createScheduleInstance

Schedule createScheduleInstance(int intervalType,
                                java.lang.String distributionType,
                                int taskType)
                                throws CasterException
Creates a new Schedule object with specified integer constant values for IntervalType, distributionType, and taskType. The acceptable CONSTANTS are as follows: intervalType: TimeInfo.ONCE, TimeInfo.MINUTE, TimeInfo.HOUR,TimeInfo.DAY,TimeInfo.WEEK,TimeInfo.MONTH, TimeInfo.YEAR distributionType:Distribution.MAIL,Distribution.FTP,Distribution.PRINT,Distribution.MRE,Distribution.LIBRARY taskType: Task.WEBFOCUS_SERVER_PROCEDURE,Task.STANDARD_REPORT,Task.MY_REPORT,Task.URL,Task.FILE If a Notification object isn't attached the default is never, and the default priority is 3.

Parameters:
intervalType - The time interval (see TimeInfo class).
distributionType - The method of distribution (see Distribution class).
taskType - The type of task (see Task class).
Returns:
A new Schedule object.
Throws:
CasterException
See Also:
TimeInfo.ONCE, TimeInfo.MINUTE, TimeInfo.HOUR, TimeInfo.DAY, TimeInfo.WEEK, TimeInfo.MONTH, TimeInfo.YEAR, Distribution.EMAIL, Distribution.FTP, Distribution.PRINT, Distribution.MRE, Distribution.LIBRARY, Task.WEBFOCUS_SERVER_PROCEDURE, Task.STANDARD_REPORT, Task.MY_REPORT, Task.URL, Task.FILE


Copyright © 2006 Information Builders, Incorporated.