|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 scheduledTask
. 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();
Method Summary | |
---|---|
java.lang.String |
addSchedule(Schedule schedule)
Takes a Schedule |
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 |
---|
Schedule getSchedule(java.lang.String scheduleId) throws CasterException
scheduleId
- Id that uniquely identifies the schedule in the repository.
Schedule
object.
CasterException
Schedule[] getScheduleInfoListByCaller() throws CasterException
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.
Schedule
objects.
CasterException
Schedule[] getScheduleInfoListByOwner(java.lang.String owner) throws CasterException
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.
owner
- The schedule owner's username.
Schedule
objects.
CasterException
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
CasterException
Schedule[] getScheduleInfoList(java.lang.String[] scheduleId) throws CasterException
CasterException
Schedule[] getScheduleList(java.lang.String[] scheduleId) throws CasterException
CasterException
java.lang.String addSchedule(Schedule schedule) throws CasterException
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
void updateSchedule(Schedule schedule) throws CasterException
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.
schedule
- A Schedule object encapsulating the existing Schedule
.
CasterException
- The msgId for the Exception thrown if the
scheduleId is not in the database is "SCH001".void deleteSchedule(java.lang.String scheduleId) throws CasterException
scheduleId
- Id that uniquely identifies the schedule in the repository.
CasterException
java.lang.String[] getOwnerList() throws CasterException
CasterException
java.lang.String run(Schedule schedule) throws CasterException
schedule
- A Schedule object encapsulating the job that is to be run.
CasterException
java.lang.String run(Schedule schedule, JobOptions jobOptions) throws CasterException
schedule
- A Schedule object encapsulating the job that is to be run.
CasterException
java.lang.String run(java.lang.String[] idList, JobOptions jobOptions) throws CasterException
CasterException
@Deprecated AmperParameter[] getAmperParameterList(Task task) throws CasterException
AmperParameter
for more information.
This method is available to the administrator and the schedule owner only.
task
- The Task
object containing the Amper variables that get
encapsulated in Array of AmperParameter objects..
AmperParameter
objects.
CasterException
AmperParameter
AmperParameter[] getAmperParameterList(Task task, java.lang.String owner) throws CasterException
AmperParameter
for more information.
This method is available to the administrator and the schedule owner only.
task
- The Task
object containing the Amper variables that get
encapsulated in Array of AmperParameter objects..owner
- The username of the schedule owner
AmperParameter
objects.
CasterException
AmperParameter
java.lang.String getScheduleId(java.lang.String owner, java.lang.String scheduleDescription) throws CasterException
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.
owner
- The username of the schedule ownerscheduleDescription
- The description of the schedule (see
Schedule.getDescription()
). Note that maximum field length is
90 characters
CasterException
Schedule createScheduleInstanceDefault() throws CasterException
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.
Schedule
object.
CasterException
Schedule createScheduleInstance(int intervalType, java.lang.String distributionType, int taskType) throws CasterException
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.
intervalType
- The time interval (see TimeInfo
class).distributionType
- The method of distribution (see
Distribution
class).taskType
- The type of task (see Task
class).
Schedule
object.
CasterException
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |