ibi.broker.api.data.console
Class Job

java.lang.Object
  extended by ibi.broker.api.data.console.Job
All Implemented Interfaces:
java.io.Serializable

public class Job
extends java.lang.Object
implements java.io.Serializable

A Job is an object that represents a schedule when it is set to run on the ReportCaster Distribution Server. Each schedule can have any number of associated jobs set to be run on The ReportCaster Distribution Server queue. There is a one-to-many relationship between a Schedule and a Job. In the out-of-the box product, Job objects are associated with the ReportCaster Console. Within the API, Job objects are managed by implementing the ConsoleManager interface. Only a ReportCaster administrator has access to jobs in ReportCaster. Moreover, because the ReportCaster Distribution Server creates jobs, the administrator cannot call any Job objects set methods, but can only call getMethods in order to retrieve information pertaining to specific jobs on queue. The code example below shows an implementation of the Category 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 C11_Get_Running 
{
        public C11_Get_Running(String[] arg) throws Exception
        {
                // Create scheduleManager & consoleManager
                CasterConnection casterConnection = Util.createCasterConnection();
                ScheduleManager scheduleManager = casterConnection.getScheduleManager();
                ConsoleManager manager = casterConnection.getConsoleManager();
                
                //create object schedule with default values from config file
                Schedule schedule = scheduleManager.createScheduleInstanceDefault();
                
                //set description
                schedule.setDescription("SdReportWait01");
                
                //set distribution to library
                StorageLibrary distribution = new StorageLibrary();
                schedule.setDistribution(distribution);
                
                //create task
                TaskStandardReport task = new TaskStandardReport();
                task.setProcedureName("app/carwait");
                task.setDomainHREF("untitled/untitled.htm");
                task.setFolderHREF("#group1stkg1e");
                task.setExecId("execid");
                task.setExecPassword("execpass");
                schedule.setTaskList(new Task[]{task});
                
                // run
                scheduleManager.run(schedule);
                
                // run
                schedule.setDescription("SdReportWait02");
                scheduleManager.run(schedule);
                
                // run
                schedule.setDescription("SdReportWait03");
                scheduleManager.run(schedule);
                
                // Retrieve job list running
                Job[] jobList = manager.getRunningJobs();
                
                // Print result
                System.out.println("ProcessId      TimeInQ                   ScheduleDescription");
                for(int i = 0; i < jobList.length; i++)
                {
                        System.out.println(jobList[i].getId() + "   " +
                                jobList[i].getStartTime().getTime().toLocaleString() + "   " +
                                jobList[i].getSchedule().getDescription());
                }
        }

        public static void main(String[] arg)
        {
                C11_Get_Running sampl = null;
                try
                {
                        System.out.println("\n******* " + C11_Get_Running.class.getName() + " *****************");
                        sampl = new C11_Get_Running(arg);
                        System.out.println(sampl.getClass().getName() + " OK");
                }
                catch(Exception ce)
                {
                        ce.printStackTrace();
                        System.out.println(sampl.getClass().getName() + " FAIL");
                }       
        }
}
 

See Also:
Serialized Form

Constructor Summary
Job()
           
 
Method Summary
 java.lang.String getDistributionServerName()
           
 java.lang.String getFullyQualifiedServerName()
           
 java.lang.String getId()
          Obtains a String identifier associated with this Job on the ReportCaster Console.
 Schedule getSchedule()
          Obtains the Schedule object being run on the Distribution Server associated with this Job.
 java.util.Calendar getStartTime()
          Obtains the time that the schedule associated with this job is either put on the queue of the Distribution Server, or sent to the WebFOCUS Reporting Server for execution.
 int getStatus()
           
 void setDistributionServerName(java.lang.String distributionServerName)
           
 void setFullyQualifiedServerName(java.lang.String fullyQualifiedServerName)
           
 void setId(java.lang.String id)
          Specifies a String identifier associated with this Job on the ReportCaster Console.
 void setSchedule(Schedule schedule)
          Assigns the Schedule object to be run on the Distribution Server.
 void setStartTime(java.util.Calendar timeInQueue)
          Specifies the time that the schedule associated with this job is either put on the queue of the Distribution Server or sent to the WebFOCUS Reporting Server for execution.
 void setStatus(int status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Job

public Job()
Method Detail

getId

public java.lang.String getId()
Obtains a String identifier associated with this Job on the ReportCaster Console. The ID is a unique process identifier assigned to each Job by the Distribution Server each time it runs a schedule, and thus uniquely identifies each instance of a schedule run on the Distribution Server. The administrator can inspect this IS using this method, but only the Distribution Server is allowed to assign a value to this identifier.

Returns:
The unique identifier to this Job as a String.
See Also:
setId(java.lang.String)

setId

public void setId(java.lang.String id)
Specifies a String identifier associated with this Job on the ReportCaster Console. The ID is a unique process identifier assigned to each Job by the Distribution Server each time it runs a schedule, and thus uniquely identifies each instance of a schedule run on the Distribution Server. The administrator can inspect this id using this method, but only the Distribution Server is allowed to assign a value to this identifier.

Parameters:
id - The String identifier for the Job.

getSchedule

public Schedule getSchedule()
Obtains the Schedule object being run on the Distribution Server associated with this Job. This method retrieves the schedule and returns it to administrator who is accessing the Job on the Console via the ConsoleManager. While the administrator can obtain and inspect a schedule, he can never set a schedule on the Distribution Server.

Returns:
The schedule object associated with this Job.
See Also:
setSchedule(Schedule)

setSchedule

public void setSchedule(Schedule schedule)
Assigns the Schedule object to be run on the Distribution Server. This method can only be executed by the Distribution Server.

Parameters:
schedule - The schedule object to be run.
See Also:
getSchedule()

getStartTime

public java.util.Calendar getStartTime()
Obtains the time that the schedule associated with this job is either put on the queue of the Distribution Server, or sent to the WebFOCUS Reporting Server for execution. This time is not a duration, but is a Calendar Object indicating the moment the Job was sent to either the job queue or execution,depending on its current. The status of the job can be determined by calling the methods getJobsInQueue() and getRunningJobs() from the ConsoleManager class. These will return an array of jobs either running or in queue. The array in which the job appears will allow the developer to know which status the time refers. This data is transitory and is not available after a job leaves a queue or completes execution. The actual calendar instance involved is a GregorianCalendar.

Returns:
The startTime as a Calendar object.
See Also:
setStartTime(Calendar)

setStartTime

public void setStartTime(java.util.Calendar timeInQueue)
Specifies the time that the schedule associated with this job is either put on the queue of the Distribution Server or sent to the WebFOCUS Reporting Server for execution. This time is not a duration, but is a Calendar Object indicating the moment the Job was sent to either the job queue or execution, depending on its current status. This data is transitory and is not available after a job leaves a queue or completes execution. The actual calendar instance involved is a GregorianCalendar. This method can only be executed by the Distribution Server.

Parameters:
timeInQueue - Calendar time the schedule was either placed in queue or submitted for execution.
See Also:
getStartTime()

getDistributionServerName

public java.lang.String getDistributionServerName()

setDistributionServerName

public void setDistributionServerName(java.lang.String distributionServerName)

getStatus

public int getStatus()

setStatus

public void setStatus(int status)

getFullyQualifiedServerName

public java.lang.String getFullyQualifiedServerName()

setFullyQualifiedServerName

public void setFullyQualifiedServerName(java.lang.String fullyQualifiedServerName)


Copyright © 2006 Information Builders, Incorporated.