|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Scheduler
This is the main interface to the NetWeaver Scheduler for Java. Applications can use this interface for all scheduler related tasks which includes scheduling jobs, viewing jobs, and browsing logfiles.
The methods of this class always return information which are related to the calling user. Administrative users will be able to access all information.
| Nested Class Summary | |
|---|---|
static class |
Scheduler.FireTimeEvent
Instances of this class specify a particular expiration of a given scheduler task. |
| Method Summary | |
|---|---|
void |
addEventListener(String[] eventsRegisteredFor,
EventConsumer consumer)
This method registers a EventConsumer for Jobs and /or tasks. |
void |
addFilters(SchedulerTaskID id,
Filter[] f)
Adds a filter to the list of filters currently associated to the given task. |
void |
cancelJob(JobID jobid)
This method cancels a job. |
void |
cancelTask(SchedulerTaskID taskId)
Cancels a scheduled task with id specified by the taskId parameter. |
SchedulerTaskID[] |
getAllSchedulerTaskIDs()
Obtains all currently scheduled scheduler tasks which are in state active or
hold. |
Job[] |
getChildJobs(JobID jobid)
Get all child jobs for a given job id. |
Scheduler.FireTimeEvent[] |
getFireTimes(SchedulerTaskID id,
SchedulerTime startTime,
SchedulerTime endTime)
This method returns the fire times of a SchedulerTask for a
given time interval specified by the startTime, endTime
and the id parameters. |
Job |
getJob(JobID jobid)
This method returns a job for a given job id jobid. |
JobDefinition |
getJobDefinitionById(JobDefinitionID id)
Get job definition by its job definition id. |
JobDefinition |
getJobDefinitionByName(String jobDefinitionName)
Returns the job defintion for a given name. |
JobDefinition[] |
getJobDefinitions()
Returns all job definitions known to the NetWeaver Scheduler. |
LogIterator |
getJobLog(JobID jobId,
LogIterator it,
int fetchSize)
This method will return the log for the given job in chunks. |
JobParameter[] |
getJobParameters(JobID jobid)
This method returns all parameters for a given job id jobid. |
JobIterator |
getJobs(JobFilter filter,
JobIterator iter,
int fetchSize)
This method will return all jobs which match the provided filter criteria. |
Job[] |
getJobs(JobID[] jobid)
This method returns the jobs for given job ids. |
JobStatus |
getJobStatus(JobID jobid)
Returns the status of a job. |
SchedulerTask |
getTask(SchedulerTaskID id)
Obtains the task with id specified by the id parameter. |
boolean |
hasChildJobs(JobID jobid)
Returns true if this job has child jobs. |
void |
holdTask(SchedulerTaskID taskId)
Holds a scheduled task with id specified by the taskId parameter. |
void |
releaseTask(SchedulerTaskID taskId)
Releases a held task with id specified by the taskId parameter and
set it back to state active. |
void |
removeEventListener(EventConsumer consumer)
This methods removes a previous registered EventConsumer. |
void |
removeFilters(SchedulerTaskID id,
Filter[] f)
Removes the given filters from the list of filters associated with the given task. |
void |
removeJob(JobID jobid)
This method removes all information about this job instance from the NetWeaver Scheduler (including logs). |
void |
removeJobs(JobID[] jobids)
This method removes all information for the given job instances from the NetWeaver Scheduler (including logs). |
void |
schedule(SchedulerTask task)
This method schedules the supplied task what means that the task will be persisted and performed. |
void |
setFilters(SchedulerTaskID id,
Filter[] f)
Sets filters for the specified task. |
| Method Detail |
|---|
void schedule(SchedulerTask task)
throws TaskValidationException,
SchedulerRuntimeException
task - the task to be scheduled
TaskValidationException - thrown if a task with this id is already
scheduled or some of the fields are invalid
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
SchedulerTask getTask(SchedulerTaskID id)
throws TaskDoesNotExistException,
SchedulerRuntimeException
id parameter. Only
one task with this id can exist.
id - the id of the task
id parameter
TaskDoesNotExistException - thrown if task with this id does not exist.
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void cancelTask(SchedulerTaskID taskId)
throws TaskDoesNotExistException,
SchedulerRuntimeException
taskId parameter.
taskId - the id of the task to be cancelled
TaskDoesNotExistException - if a task with such id does not exist or
the task can not be cancelled
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void holdTask(SchedulerTaskID taskId)
throws TaskDoesNotExistException,
SchedulerRuntimeException
taskId parameter.
Holding a task means that it will be suspended from further execution until
realeaseTask(taskId) will be called which sets the task back to active.
taskId - id of the task to be hold
TaskDoesNotExistException - if a task with such id does not exist.
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.releaseTask(SchedulerTaskID taskId)
void releaseTask(SchedulerTaskID taskId)
throws TaskDoesNotExistException,
SchedulerRuntimeException
taskId parameter and
set it back to state active. This method takes only effect if the task was
set to hold before.
taskId - id of the task to be released
TaskDoesNotExistException - if a task with taskId and set to HOLD
does not exist.
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.holdTask(SchedulerTaskID taskId)
void setFilters(SchedulerTaskID id,
Filter[] f)
throws TaskDoesNotExistException,
SchedulerRuntimeException
f parameter. This method could also be useful to remove
all filters associated with the given task by calling setFilters(id, new Filter[0]).
id - id of the taskf - array of filters
TaskDoesNotExistException - - if task with id specified by id parameter does not exist
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void addFilters(SchedulerTaskID id,
Filter[] f)
throws TaskDoesNotExistException,
SchedulerRuntimeException
id - id of the taskf - array of filters to be associated with the given task
TaskDoesNotExistException - thrown if the given task does not exist
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void removeFilters(SchedulerTaskID id,
Filter[] f)
throws TaskDoesNotExistException,
SchedulerRuntimeException
f are not found among the list of filters associated with the given task.
It simply removes all the filters that are found both in f and the list of currently
associated filters.
id - task whose filters will be removedf - filters which will be removed from the list of filters associated to task id
TaskDoesNotExistException - thrown if the task specified by id does not exist.
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
SchedulerTaskID[] getAllSchedulerTaskIDs()
throws SchedulerRuntimeException
active or
hold.
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
Scheduler.FireTimeEvent[] getFireTimes(SchedulerTaskID id,
SchedulerTime startTime,
SchedulerTime endTime)
throws TaskDoesNotExistException,
TooManyFireEventsException,
SchedulerRuntimeException
SchedulerTask for a
given time interval specified by the startTime, endTime
and the id parameters.
id - the task idstartTime - the start time of the intervalendTime - the end time of the interval
FireTimeEvents
TooManyFireEventsException - if there are too many executions of this task
in the given interval
TaskDoesNotExistException - thrown if the task specified by id does not exist.
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
JobDefinition[] getJobDefinitions()
throws SchedulerRuntimeException
Note: Also undeployed job definitions are also returned
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
JobDefinition getJobDefinitionByName(String jobDefinitionName)
throws SchedulerRuntimeException
Note: This method will only return current job definitions. It will not return job definitions from undepoyed applications.
jobDefinitionName - the name of job definition
null if there is no such job definition
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
JobDefinition getJobDefinitionById(JobDefinitionID id)
throws SchedulerRuntimeException
Note: This method will return also job definitions from undeployed applications.
id - the job definition id
null if there is no such job definition
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void cancelJob(JobID jobid)
throws JobIllegalStateException,
SchedulerRuntimeException
CANCELLED state. If it has been started,
it will cooperatively try to abort the job. This method will just return with no
indication whether the job was successfully cancelled or not.
This method will only allow jobs to be cancelled which run under the same user id as the caller.
jobid - job id for the running job
JobIllegalStateException - thrown if the job is not status
RUNNING
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.JobContext.isCancelled()
Job[] getChildJobs(JobID jobid)
throws NoSuchJobException,
SchedulerRuntimeException
jobid - the id for the job
NoSuchJobException - thrown if a job with the given job id does not exist
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
boolean hasChildJobs(JobID jobid)
throws NoSuchJobException,
SchedulerRuntimeException
jobid - job id to use
NoSuchJobException - thrown if a job with the given job id does not exist
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void removeJob(JobID jobid)
throws JobIllegalStateException,
NoSuchJobException,
SchedulerRuntimeException
COMPLETED,
ERROR or UNKNOWN,
CANCELLED.
jobid - the job id to use
JobIllegalStateException - thrown if the to be removed is not in one state
mentioned above.
NoSuchJobException - thrown if a job with the given job id does not exist
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void removeJobs(JobID[] jobids)
throws SchedulerRuntimeException
jobids - the job ids to use
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
Job getJob(JobID jobid)
throws SchedulerRuntimeException
jobid.
jobid - the job id of the job
null if there is no such job
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
JobParameter[] getJobParameters(JobID jobid)
throws NoSuchJobException,
SchedulerRuntimeException
jobid.
jobid - the given job is
NoSuchJobException - if there is no job with the given id
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
Job[] getJobs(JobID[] jobid)
throws SchedulerRuntimeException
jobid - the job ids of the jobs
null.
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
LogIterator getJobLog(JobID jobId,
LogIterator it,
int fetchSize)
throws NoSuchJobException,
SchedulerRuntimeException
LogIterator iter = scheduler.getJobLog(jobId, null, 1000);
String log = iter.nextChunk();
// do something with the returned log String
while(iter.hasMoreChunks()) {
iter = scheduler.getJobLog(jobId, iter, 1000);
log = iter.nextChunk();
// do something with the returned log
}
NoSuchJobException - if the job with the id jobId does not exist
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
JobStatus getJobStatus(JobID jobid)
throws NoSuchJobException,
SchedulerRuntimeException
jobid - the given job id
NoSuchJobException - if the job with the id jobId does not exist
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
JobIterator getJobs(JobFilter filter,
JobIterator iter,
int fetchSize)
throws SchedulerRuntimeException
JobIterator iter = scheduler.getJobs(myFilter, null, 1000);
Job[] jobs = iter.nextChunk();
// do something with the returned job ojbects
while(iter.hasMoreChunks()) {
iter = scheduler.getJobs(myFilter, iter, 1000);
Job[] jobs = iter.nextChunk();
// do something with the returned job objects
//
}
filter - the pre-initialized filter objectiter - an iterator which has been returned by a previous invocation
or null if this is the first callfetchSize - the number of records to fetch
JobIterator object which contains the next chunk of
data
SchedulerRuntimeException - RuntimeException thrown if
there is a problem with the underlying infrastructure.
void addEventListener(String[] eventsRegisteredFor,
EventConsumer consumer)
EventConsumer interface and register for the events to listen for. The available
events are listed in class Event.
Examples afor events are
EVENT_JOB_STARTING,
EVENT_JOB_FINISHED,
EVENT_TASK_CREATED,
EVENT_TASK_FINISHED,
and so on.
If you want to register for all available events you might use the String[]
from RUNTIME_EVENT_TYPES.
If one and the same EventConsumer is registered a second time an
IllegalArgumentException will be thrown.
Note: All events for which the user registers here for are delivered to every server node within the cluster. The user has to take care if events should be processed only at one server node.
eventsRegisteredFor - the String[] with the events to register forconsumer - the implementation of an EventConsumerEvent,
EventConsumer,
removeEventListener(EventConsumer)void removeEventListener(EventConsumer consumer)
consumer - the EventConsumer to remove| Access Rights |
|---|
| SC | DC |
|---|---|
[sap.com] ENGFACADE
|
[sap.com] tc/je/scheduler/api
|
|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||