IBM WebSphere Extended Deployment (XD)TM
Release 6.0

com.ibm.websphere.longrun
JobScheduler

All Implemented Interfaces
EJBObject


This is the remote interface for the Long Running Scheduler EJB. Clients of this interface can programmatically submit and manipulate long running jobs to the Long Running Scheduler. Code similiar to the following can be used to lookup and invoke the remote Long Running Scheduler EJB interface:

InitialContext ctxt = new InitialContext();
Hashtable env = new Hashtable();
env.put (Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "corbaloc:rir:/NameServiceCellRoot");
ctxt = new InitialContext(env);
// in order to lookup the Long Running Scheduler EJB from the cell context in the namespace,
// the name context to the application server or cluster to which the Long Running Scheduler
// application is deployed has to be provided.
// Eg: "nodes/myNode/servers/myServer" or "clusters/myCluster".

String longRunningContext = clusters/myCluster;

JobSchedulerHome zjsHome = (JobSchedulerHome) ctxt.lookup(longRunningContext + "/ejb/com/ibm/websphere/longrun/JobSchedulerHome");
JobScheduler js = zjsHome.create();



Method Summary
public  StringsubmitJobFromRepository(java.lang.String)
          
public  StringsubmitJob(java.lang.String)
          
public  StringsaveJobToRepositoryAndSubmit(java.lang.String, java.lang.String, boolean)
           submits the job specified by the xJCL passed in to the long running scheduler and saves the xJCL to the xJCL repository.
public  voidpurgeJob(java.lang.String)
           purges the job identified by the job id from the long running scheduler.
public  voidcancelJob(java.lang.String)
          
public  voidrestartJob(java.lang.String)
           restarts the job identified by the job id.
public  intgetJobStatus(java.lang.String)
           returns the job status for the given job id. Look at the jobStatus api for comparing the integer.
public  StringgetJobOutput(java.lang.String)
           Returns the output for a given job id that displays the job's progress.
public  StringgetJobDetails(java.lang.String)
           returns the job details for the given job id. Look at the jobDetails api for the details of the details.
public  voidsaveJobToRepository(java.lang.String, java.lang.String, boolean)
           Saves the xJCL passed in to the xJCL Repository.
public  StringshowJobFromRepository(java.lang.String)
           Returns the xJCL from xJCL repository for the given job name.
public  voidremoveJobFromRepository(java.lang.String)
          
public  StringshowAllJobs()
          
public  voidsuspendJob(java.lang.String, java.lang.String)
           suspends the specified job for the number of seconds specified. Once the time period is up, the job automatically.
public  voidresumeJob(java.lang.String)
           resumes specified job.
public  intgetBatchJobRC(java.lang.String)
           returns the return code of the Batch job.
public  StringsubmitDelayedJob(java.lang.String, java.lang.String)
          
public  StringsubmitDelayedJobFromRepository(java.lang.String, java.lang.String)
          
public  StringsaveDelayedJobToRepositoryAndSubmit(java.lang.String, java.lang.String, boolean, java.lang.String)
          
public  voidsubmitRecurringRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
          
public  voidsubmitRecurringRequestFromRepository(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
          
public  voidcancelRecurringRequest(java.lang.String)
          
public  StringgetRecurringRequestDetails(java.lang.String)
          
public  voidmodifyRecurringRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
          
public  StringshowAllRecurringRequests()
          
public  StringshowRecurringJobs(java.lang.String)
          

Inherited Methods

Methods inherited from javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove

Method Detail

submitJobFromRepository

public String submitJobFromRepository(String job)
submits the specified job, saved in the xJCL repository, to the long running scheduler
Parameters:
    job - The name of job that was stored to the xJCL repository


Returns:
     the job id assigned by long running scheduler to the submitted job


Throws:
InvalidJobNameException
SchedulerException
JCLException
JobSubmissionException


submitJob

public String submitJob(String xJCL)
submits the job specified by the xJCL passed in to the long running scheduler
Parameters:
    xJCL - The xJCL for the job


Returns:
     the job id assigned by long running scheduler to the submitted job


Throws:
SchedulerException
JCLException
JobSubmissionException


saveJobToRepositoryAndSubmit

public String saveJobToRepositoryAndSubmit(String xJCL,String job, boolean replace)
submits the job specified by the xJCL passed in to the long running scheduler and saves the xJCL to the xJCL repository.
Parameters:
    xJCL - The xJCL for the job
    job - The name given to the saved job in xJCL repository. This name can be used when invoking the submitJobFromRepository method.
    replace - A boolean indicating if the xJCL in the repository should be replaced, in case a job by that name already exists in the xJCL repository.


Returns:
     the job id assigned by long running scheduler to the submitted job


Throws:
InvalidOperationException
SchedulerException
JCLException
JobSubmissionException


purgeJob

public void purgeJob(String jobid)
purges the job identified by the job id from the long running scheduler.
Parameters:
    jobid - The id of the job


Throws:
InvalidJobIDException
SchedulerException


cancelJob

public void cancelJob(String jobid)
cancels the job identified by the job id
Parameters:
    jobid - The id of the job


Throws:
InvalidOperationException
InvalidJobIDException
SchedulerException


restartJob

public void restartJob(String jobid)
restarts the job identified by the job id.
Parameters:
    jobid - The id of the job


Throws:
InvalidJobIDException
InvalidOperationException
SchedulerException
JCLException
JobSubmissionException


getJobStatus

public int getJobStatus(String jobid)
returns the job status for the given job id. Look at the jobStatus api for comparing the integer returned by this method.
Parameters:

Returns:
     the status of the job


Throws:
InvalidJobIDException
SchedulerException


getJobOutput

public String getJobOutput(String jobid)
Returns the output for a given job id that displays the job's progress. This only applies to batch jobs.
Parameters:

Returns:
     the output of the jobs


Throws:
InvalidJobIDException
SchedulerException


getJobDetails

public String getJobDetails(String jobid)
returns the job details for the given job id. Look at the jobDetails api for the details of the details returned by this method.
Parameters:

Returns:
     the details of the job


Throws:
InvalidJobIDException
SchedulerException


saveJobToRepository

public void saveJobToRepository(String xJCL,String job, boolean replace)
Saves the xJCL passed in to the xJCL Repository.
Parameters:
    xJCL - The xJCL for the job
    job - The name given to the saved job in xJCL repository. This name can be used when invoking the submitJobFromRepository method.
    replace - A boolean indicating if the xJCL in the repository should be replaced, in case a job by that name already exists in the xJCL repository.


Throws:
InvalidOperationException
SchedulerException
JCLException


showJobFromRepository

public String showJobFromRepository(String job)
Returns the xJCL from xJCL repository for the given job name.
Parameters:
    job - The name given to the saved job in xJCL repository. This name can be used when invoking the submitJobFromRepository method.


Returns:
     the xJCL for the given job


Throws:
InvalidJobNameException
SchedulerException


removeJobFromRepository

public void removeJobFromRepository(String job)
removes the xJCL for the specifed job from the xJCL repository
Parameters:
    job - The name given to the saved job in xJCL repository.


Throws:
InvalidJobNameException
SchedulerException


showAllJobs

public String showAllJobs()
shows the status of all jobs in the long running scheduler


Throws:
SchedulerException


suspendJob

public void suspendJob(String jobid,String seconds)
suspends the specified job for the number of seconds specified. Once the time period is up, the job automatically resumes. This only applies to batch jobs.
Parameters:

Throws:
InvalidJobIDException
InvalidOperationException
SchedulerException
SchedulerException


resumeJob

public void resumeJob(String jobid)
resumes specified job. This only applies to batch jobs.
Parameters:
    jobid - The id of the job to resume


Throws:
InvalidJobIDException
InvalidOperationException
SchedulerException


getBatchJobRC

public int getBatchJobRC(String jobid)
returns the return code of the Batch job.
Parameters:
    jobid - The id of the job


Throws:
InvalidJobIDException
InvalidOperationException
SchedulerException


submitDelayedJob

public String submitDelayedJob(String xJCL,String startTime)
Parameters:
    xJCL - The xJCL for the job
    startTime - The time where the job will get submitted.


Returns:
     the job id assigned by long running scheduler to the submitted job


Throws:
SchedulerException
JCLException
JobSubmissionException
InvalidStartDateTimeFormatException
StaleTimeException
RemoteException


submitDelayedJobFromRepository

public String submitDelayedJobFromRepository(String job,String startTime)
Parameters:
    job - The name of job that was stored to the job repository
    startTime - The time where the job will get submitted.


Returns:
     the job id assigned by long running scheduler to the submitted job


Throws:
InvalidJobNameException
SchedulerException
JCLException
JobSubmissionException
InvalidStartDateTimeFormatException
StaleTimeException
RemoteException


saveDelayedJobToRepositoryAndSubmit

public String saveDelayedJobToRepositoryAndSubmit(String xJCL,String job, boolean replace, String startTime)
Parameters:
    xJCL - The xJCL for the job
    job - The time where the job will get submitted.
    replace - The name of job that was stored to the job repository
    startTime - A boolean indicating if the xJCL in the repository should be replaced, in case a job by that name already exists in the job repository.


Returns:
     the job id assigned by long running scheduler to the submitted job


Throws:
InvalidOperationException
SchedulerException
JCLException
JobSubmissionException
InvalidStartDateTimeFormatException
StaleTimeException
RemoteException


submitRecurringRequest

public void submitRecurringRequest(String reqId,String xJCL, String startTime, String interval)
Parameters:
    reqId - The name of the recurring job request
    xJCL - The xJCL for the job
    startTime - The time where the job will get submitted.
    interval - The time interval between jobs


Throws:
InvalidOperationException
SchedulerException
JCLException
InvalidStartDateTimeFormatException
StaleTimeException
InvalidIntervalException
RemoteException


submitRecurringRequestFromRepository

public void submitRecurringRequestFromRepository(String jobName,String reqId, String startTime, String interval)
Parameters:
    jobName - The name of job that was stored to the job repository
    reqId - The name of the recurring job request
    startTime - The time where the job will get submitted.
    interval - The time interval between jobs


Throws:
InvalidOperationException
SchedulerException
JCLException
InvalidStartDateTimeFormatException
StaleTimeException
InvalidIntervalException
InvalidJobNameException
RemoteException


cancelRecurringRequest

public void cancelRecurringRequest(String reqId)
Parameters:
    reqId - The name of the recurring job request


Throws:
InvalidOperationException
SchedulerException
RemoteException


getRecurringRequestDetails

public String getRecurringRequestDetails(String reqId)
Parameters:
    reqId - The name of the recurring job request


Returns:
     information about the request such as request name, job name, start time and interval


Throws:
SchedulerException
RemoteException


modifyRecurringRequest

public void modifyRecurringRequest(String reqId,String xJCL, String startTime, String interval)
Parameters:
    reqId - The name of the recurring job request
    xJCL - The xJCL for the job
    startTime - The time where the job will get submitted.
    interval - The time interval between jobs


Throws:
SchedulerException
JCLException
InvalidOperationException
InvalidStartDateTimeFormatException
StaleTimeException
InvalidIntervalException
RemoteException


showAllRecurringRequests

public String showAllRecurringRequests()


Returns:
     a list of all recurring requests currently in the system


Throws:
SchedulerException
RemoteException


showRecurringJobs

public String showRecurringJobs(String reqId)
Parameters:
    reqId - the name of the recurring job request


Returns:
     the list of recurring jobs created by this request


Throws:
SchedulerException
RemoteException


IBM WebSphere Extended Deployment (XD)TM
Release 6.0