com.sap.scheduler.api

Class SchedulerTask

java.lang.Object
  extended by com.sap.scheduler.api.SchedulerTask
All Implemented Interfaces:
Serializable

public class SchedulerTask
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  String m_runAsUser
           
protected  String m_schedulingUser
           
protected  short m_taskSource
           
protected  TaskStatus m_taskStatus
           
static short TASK_SOURCE_SCHEDULER_API
           
static short TASK_SOURCE_ZERO_ADMIN
           
 
Constructor Summary
SchedulerTask(SchedulerTaskID taskId, JobDefinitionID jobDefinitionId, JobParameter[] jobParameters, RecurringEntry[] recs, CronEntry[] crons)
          Deprecated. - please use create-method instead Constructs a new SchedulerTask instance with the specified id, job definition id, parameters and schedule. When an object is created with this constructor a call to getRetentionPeriod would throw IllegalStateException and isRetentionDefault would return true.
SchedulerTask(SchedulerTaskID taskId, JobDefinitionID jobDefinitionId, JobParameter[] jobParameters, RecurringEntry[] recs, CronEntry[] crons, Filter[] filters, int retentionPeriod)
          Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.
SchedulerTask(SchedulerTaskID taskId, JobDefinitionID jobDefinitionId, JobParameter[] jobParameters, RecurringEntry[] recs, CronEntry[] crons, Filter[] filters, int retentionPeriod, String name, String description, String customData)
          Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.
SchedulerTask(SchedulerTaskID taskId, JobDefinitionID jobDefinitionId, JobParameter[] jobParameters, RecurringEntry[] recs, CronEntry[] crons, String name, String description)
          Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.
SchedulerTask(SchedulerTaskID taskId, JobDefinitionID jobDefinitionId, JobParameter[] jobParameters, RecurringEntry[] recs, CronEntry[] crons, String name, String description, String customData)
          Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.
 
Method Summary
 boolean compareSchedulerTask(SchedulerTask task)
          Compares a SchedulerTask with this.
static SchedulerTask createSchedulerTask(JobDefinitionID jobDefinitionId, JobParameter[] jobParameters, RecurringEntry[] recs, CronEntry[] crons, Filter[] filters, int retentionPeriod, String name, String description, String customData)
          Creates a new SchedulerTask instance with the specified parameters.
 CronEntry[] getCronEntries()
           
 String getCustomData()
           
 String getDescription()
           
 Filter[] getFilters()
          Obtains the filters associated with this scheduler task.
 JobDefinitionID getJobDefinitionId()
          Obtains the id of the job definition whose instances are triggered by this scheduler task
 JobParameter[] getJobParameters()
          Obtains the parameters of this scheduler task.
 String getName()
           
 RecurringEntry[] getRecurringEntries()
           
 int getRetentionPeriod()
          Obtains the retention period in days.
 String getRunAsUser()
           
 String getSchedulingUser()
           
 SchedulerTaskID getTaskId()
          Obtains the id of this scheduler task
 short getTaskSource()
           
 String getTaskSourceDescription()
           
 TaskStatus getTaskStatus()
           
 String toFormattedString()
          Returns this SchedulerTask in a formatted way
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TASK_SOURCE_SCHEDULER_API

public static final short TASK_SOURCE_SCHEDULER_API
See Also:
Constant Field Values

TASK_SOURCE_ZERO_ADMIN

public static final short TASK_SOURCE_ZERO_ADMIN
See Also:
Constant Field Values

m_taskSource

protected short m_taskSource

m_taskStatus

protected TaskStatus m_taskStatus

m_schedulingUser

protected String m_schedulingUser

m_runAsUser

protected String m_runAsUser
Constructor Detail

SchedulerTask

public SchedulerTask(SchedulerTaskID taskId,
                     JobDefinitionID jobDefinitionId,
                     JobParameter[] jobParameters,
                     RecurringEntry[] recs,
                     CronEntry[] crons)
Deprecated. - please use create-method instead Constructs a new SchedulerTask instance with the specified id, job definition id, parameters and schedule. When an object is created with this constructor a call to getRetentionPeriod would throw IllegalStateException and isRetentionDefault would return true.

Parameters:
taskId - - id of this scheduler task. Can not be null.
jobDefinitionId - - Id of the job definition whose instances will be triggered by this SchedulerTask. Can not be null
jobParameters - - Parameters of the job. These should match the job parameter definition in the job definition. The passed parameters are not validated by this constructor. I.e. arbitrary JobParameter instances can be passed. identity id with the parameters specified by jobParameters will be created.
recs - - recurring entries
crons - - cron entries
Throws:
NullPointerException - - if taskId, JobDefinitionId, jobParameters or timeTable is null.

SchedulerTask

public SchedulerTask(SchedulerTaskID taskId,
                     JobDefinitionID jobDefinitionId,
                     JobParameter[] jobParameters,
                     RecurringEntry[] recs,
                     CronEntry[] crons,
                     Filter[] filters,
                     int retentionPeriod)
Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.

Parameters:
taskId - - Id of this scheduler task. Can not be null.
jobDefinitionId - - id of the job definition whose instances will be triggered by this SchedulerTask. Can not be null
jobParameters - - Parameters of the job. These should match the job parameter definition in the job definition. The passed parameters are not validated by this constructor. I.e. arbitrary JobParameter instances can be passed. A copy of the passed arguments are stored in the SchedulerTask instance. Thus changes to the passed array of parameters would not reflect this instance. identity id with the parameters specified by jobParameters will be created.
recs - - recurring entries
crons - - cron entries
filters - - A list of filters to filter out specific job expirations. Can be null. If the passed parameter is not null then a copy of the array is stored in the SchedulerTask instance. Thus changes to the passed array of filters would not reflect this instance.
retentionPeriod - - Number of days to keep the job log records after each job execution. -2 means the default from the job definition -1 means infinity i.e. job log records are never deleted.
Throws:
NullPointerException - - thrown if taskId or jobDefinitionId is null.
IllegalArgumentException - - thrown if retentionPeriod is less than -2.

SchedulerTask

public SchedulerTask(SchedulerTaskID taskId,
                     JobDefinitionID jobDefinitionId,
                     JobParameter[] jobParameters,
                     RecurringEntry[] recs,
                     CronEntry[] crons,
                     String name,
                     String description)
Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.

Parameters:
taskId - - Id of this scheduler task. Can not be null.
jobDefinitionId - - id of the job definition whose instances will be triggered by this SchedulerTask. Can not be null
jobParameters - - Parameters of the job. These should match the job parameter definition in the job definition. The passed parameters are not validated by this constructor. I.e. arbitrary JobParameter instances can be passed. A copy of the passed arguments are stored in the SchedulerTask instance. Thus changes to the passed array of parameters would not reflect this instance. identity id with the parameters specified by jobParameters will be created.
recs - - recurring entries
crons - - cron entries
name - - Name for this scheduler task. If not set, the name will be taken from the job definition
description - - Description for this task, e.g. "General backup job running every Friday, do not skip". It can be null.
Throws:
NullPointerException - - thrown if taskId or jobDefinitionId is null.
IllegalArgumentException - - thrown if retentionPeriod is less than -2.

SchedulerTask

public SchedulerTask(SchedulerTaskID taskId,
                     JobDefinitionID jobDefinitionId,
                     JobParameter[] jobParameters,
                     RecurringEntry[] recs,
                     CronEntry[] crons,
                     String name,
                     String description,
                     String customData)
Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.

Parameters:
taskId - - Id of this scheduler task. Can not be null.
jobDefinitionId - - id of the job definition whose instances will be triggered by this SchedulerTask. Can not be null
jobParameters - - Parameters of the job. These should match the job parameter definition in the job definition. The passed parameters are not validated by this constructor. I.e. arbitrary JobParameter instances can be passed. A copy of the passed arguments are stored in the SchedulerTask instance. Thus changes to the passed array of parameters would not reflect this instance. identity id with the parameters specified by jobParameters will be created.
recs - - recurring entries
crons - - cron entries
name - - Name for this scheduler task. If not set, the name will be taken from the job definition
description - - Description for this task, e.g. "General backup job running every Friday, do not skip". It can be null.
customData - - String, can be used by an application to store application dependent context data. Ignored by the job scheduler. It can be null.
Throws:
NullPointerException - - thrown if taskId or jobDefinitionId is null.
IllegalArgumentException - - thrown if retentionPeriod is less than -2.

SchedulerTask

public SchedulerTask(SchedulerTaskID taskId,
                     JobDefinitionID jobDefinitionId,
                     JobParameter[] jobParameters,
                     RecurringEntry[] recs,
                     CronEntry[] crons,
                     Filter[] filters,
                     int retentionPeriod,
                     String name,
                     String description,
                     String customData)
Deprecated. - please use create-method instead Constrcuts a new SchedulerTas instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.

Parameters:
taskId - - Id of this scheduler task. Can not be null.
jobDefinitionId - - id of the job definition whose instances will be triggered by this SchedulerTask. Can not be null
jobParameters - - Parameters of the job. These should match the job parameter definition in the job definition. The passed parameters are not validated by this constructor. I.e. arbitrary JobParameter instances can be passed. A copy of the passed arguments are stored in the SchedulerTask instance. Thus changes to the passed array of parameters would not reflect this instance. identity id with the parameters specified by jobParameters will be created.
recs - - recurring entries
crons - - cron entries
filters - - A list of filters to filter out specific job expirations. Can be null. If the passed parameter is not null then a copy of the array is stored in the SchedulerTask instance. Thus changes to the passed array of filters would not reflect this instance.
retentionPeriod - - Number of days to keep the job log records after each job execution. -2 means the default from the job definition -1 means infinity i.e. job log records are never deleted.
name - - Name for this scheduler task. If not set, the name will be taken from the job definition
description - - Description for this task, e.g. "General backup job running every Friday, do not skip". It can be null.
customData - - String, can be used by an application to store application dependent context data. Ignored by the job scheduler. It can be null.
Throws:
NullPointerException - - thrown if taskId or jobDefinitionId is null.
IllegalArgumentException - - thrown if retentionPeriod is less than -2.
Method Detail

createSchedulerTask

public static SchedulerTask createSchedulerTask(JobDefinitionID jobDefinitionId,
                                                JobParameter[] jobParameters,
                                                RecurringEntry[] recs,
                                                CronEntry[] crons,
                                                Filter[] filters,
                                                int retentionPeriod,
                                                String name,
                                                String description,
                                                String customData)
Creates a new SchedulerTask instance with the specified parameters. Weh an object is created with this construtor isRetentionDefault would return false and getRetentionPeriod would return the value of the retentionPeriod argument.

Parameters:
jobDefinitionId - - id of the job definition whose instances will be triggered by this SchedulerTask. Can not be null
jobParameters - - Parameters of the job. These should match the job parameter definition in the job definition. The passed parameters are not validated by this constructor. I.e. arbitrary JobParameter instances can be passed. A copy of the passed arguments are stored in the SchedulerTask instance. Thus changes to the passed array of parameters would not reflect this instance. identity id with the parameters specified by jobParameters will be created.
recs - - recurring entries
crons - - cron entries
filters - - A list of filters to filter out specific job expirations. Can be null. If the passed parameter is not null then a copy of the array is stored in the SchedulerTask instance. Thus changes to the passed array of filters would not reflect this instance.
retentionPeriod - - Number of days to keep the job log records after each job execution. -2 means the default from the job definition -1 means infinity i.e. job log records are never deleted.
name - - Name for this scheduler task. If not set, the name will be taken from the job definition
description - - Description for this task, e.g. "General backup job running every Friday, do not skip". It can be null.
customData - - String, can be used by an application to store application dependent context data. Ignored by the job scheduler. It can be null.
Throws:
NullPointerException - - thrown if taskId or jobDefinitionId is null.
IllegalArgumentException - - thrown if retentionPeriod is less than -2.

getRetentionPeriod

public int getRetentionPeriod()
Obtains the retention period in days.

Returns:
the retention period in days. -2 means the default specified by the job definition, -1 means infinity, 0 means that records are not kept. N, where N > 0 means that the records are kept for at least n days

getTaskId

public SchedulerTaskID getTaskId()
Obtains the id of this scheduler task

Returns:
the id of this scheduler task

getJobDefinitionId

public JobDefinitionID getJobDefinitionId()
Obtains the id of the job definition whose instances are triggered by this scheduler task

Returns:
the id of the job definition whose instances are triggered by this scheduler task

getJobParameters

public JobParameter[] getJobParameters()
Obtains the parameters of this scheduler task. These parameters are passed to each job instance triggered by this scheduler task.

Returns:
the parameters of this scheduler task.

getFilters

public Filter[] getFilters()
Obtains the filters associated with this scheduler task. The return value is never null.

Returns:
the filters associated with this scheduler task.

getRecurringEntries

public RecurringEntry[] getRecurringEntries()

getCronEntries

public CronEntry[] getCronEntries()

getCustomData

public String getCustomData()
Returns:
Returns the custom data set with this SchedulerTask.

getDescription

public String getDescription()
Returns:
Returns the description of this SchedulerTask.

getName

public String getName()
Returns:
Returns the name of this SchedulerTask.

getTaskSource

public short getTaskSource()
Returns:
Returns the taskSource.

getTaskSourceDescription

public String getTaskSourceDescription()
Returns:
Returns the taskSource.

getTaskStatus

public TaskStatus getTaskStatus()
Returns:
Returns the TaskStatus.

getSchedulingUser

public String getSchedulingUser()
Returns:
Returns the scheduling user.

getRunAsUser

public String getRunAsUser()
Returns:
Returns the scheduling user.

compareSchedulerTask

public boolean compareSchedulerTask(SchedulerTask task)
Compares a SchedulerTask with this.

Parameters:
task - the SchedulerTask to compare
Returns:
true if the SchedulerTask are equal in case of its members, false otherwise.

toFormattedString

public String toFormattedString()
Returns this SchedulerTask in a formatted way

Returns:
SchedulerTask in formatted way
Access Rights

This class can be accessed from:


SC DC
[sap.com] ENGFACADE [sap.com] tc/je/scheduler/api


Copyright 2010 SAP AG Complete Copyright Notice