PTP
Release 7.0

org.eclipse.ptp.core.jobs
Interface IJobControl


public interface IJobControl

Interface for performing control operations on jobs (including submitting jobs). Clients can obtain instances of this interface from the launch delegate.

Since:
6.0

Field Summary
static String HOLD_OPERATION
          Control operation to put a job on hold
static String RELEASE_OPERATION
          Control operation to release a job from hold
static String RERUN_OPERATION
          Rerun the job.
static String RESUME_OPERATION
          Control operation to resume a suspended job
static String SUSPEND_OPERATION
          Control operation to suspend a job
static String TERMINATE_OPERATION
          Control operation to terminate a job
 
Method Summary
 void control(String jobId, String operation, IProgressMonitor monitor)
          Perform control operation on job.
 String getControlId()
          Get the ID of this job controller
 IJobStatus getJobStatus(String jobId, boolean force, IProgressMonitor monitor)
          Get the status of the job.
 IJobStatus getJobStatus(String jobId, IProgressMonitor monitor)
          Get the status of the job.
 String submitJob(ILaunchConfiguration launchConfig, String launchMode, IProgressMonitor monitor)
          Submit a job for execution
 

Field Detail

SUSPEND_OPERATION

static final String SUSPEND_OPERATION
Control operation to suspend a job

See Also:
Constant Field Values

RESUME_OPERATION

static final String RESUME_OPERATION
Control operation to resume a suspended job

See Also:
Constant Field Values

HOLD_OPERATION

static final String HOLD_OPERATION
Control operation to put a job on hold

See Also:
Constant Field Values

RELEASE_OPERATION

static final String RELEASE_OPERATION
Control operation to release a job from hold

See Also:
Constant Field Values

TERMINATE_OPERATION

static final String TERMINATE_OPERATION
Control operation to terminate a job

See Also:
Constant Field Values

RERUN_OPERATION

static final String RERUN_OPERATION
Rerun the job. Note that this is currently only used to resend input to a job that is already in running state.

Since:
7.0
See Also:
Constant Field Values
Method Detail

control

void control(String jobId,
             String operation,
             IProgressMonitor monitor)
             throws CoreException
Perform control operation on job.

Parameters:
jobId - job ID representing the job to be canceled.
operation - operation to perform on the job
monitor - the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot be cancelled.
Throws:
CoreException
Since:
5.0

getControlId

String getControlId()
Get the ID of this job controller


getJobStatus

IJobStatus getJobStatus(String jobId,
                        boolean force,
                        IProgressMonitor monitor)
                        throws CoreException
Get the status of the job. The could potentially be a long running operation. If the progress monitor is canceled, the method will return an undetermined status.

Note that this call may be throttled using a predetermined timeout by the rsource manager implementation. To avoid the throttle, set the force flag to true.

Parameters:
jobId - ID of job used to obtain status
force - if true, tells the resource manager to ignore the throttling timeout.
monitor - the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot be cancelled.
Returns:
status of the job or undetermined status if the progress monitor is canceled
Throws:
CoreException

getJobStatus

IJobStatus getJobStatus(String jobId,
                        IProgressMonitor monitor)
                        throws CoreException
Get the status of the job. The could potentially be a long running operation. If the progress monitor is canceled, the method will return an undetermined status.

Note that this call may be throttled using a predetermined timeout by the rsource manager implementation. To avoid the throttle, use the overloaded method.

This method is equivalent to getJobStatus(String, boolean, IProgressMonitor) with flag set to false.

Parameters:
jobId - ID of job used to obtain status
monitor - the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot be cancelled.
Returns:
status of the job or undetermined status if the progress monitor is canceled
Throws:
CoreException

submitJob

String submitJob(ILaunchConfiguration launchConfig,
                 String launchMode,
                 IProgressMonitor monitor)
                 throws CoreException
Submit a job for execution

Parameters:
launchConfig - job launch configuration
mode - job launch mode
monitor - the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot be cancelled.
Returns:
job ID that can be used to identify the job
Throws:
CoreException
Since:
7.0

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.