public class AddJobCmdImpl extends ControllerCommandImpl implements AddJobCmd
This class adds a job to the WebSphere Commerce Server's scheduler.
The parameters passed to the command are:
This command will verify the value specified for the schedule job. If any value is missing or incorrect, an exception is thrown. If the values are okay, the new schedule job is added by adding a record to the SCHCONFIG and SCHACTIVE tables. The information found in the SCHCONFIG table contains the configuration information for executing the schedule job. The record in the SCHACTIVE record will determine when to execute the job next.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
AddJobCmdImpl()
This is the default constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
protected static java.sql.Timestamp | convertTime(java.lang.String time)
This method converts the input time value to a java.sql.Timestamp object.
|
java.lang.String | getApplicationType()
This method gets the application type for the job to be added.
|
java.lang.Integer | getAttempts()
This method gets the number of re-attempts when error occurs.
|
java.lang.Integer | getCheckCommandId()
This method gets the id of the check command.
|
java.lang.Integer | getDelay()
This method gets the delay time between re-attempts when an error occurs.
|
protected java.lang.String | getEndTime()
This method gets a Timestamp object that represents the end time for the request.
|
protected java.lang.String | getErrorUrl()
This method gets the error URL to which we should be redirected at the end of the command in case of an error.
|
java.lang.String | getHost()
This method gets the scheduler instance name that uniquely identifies the scheduler for a JVM of the WebSphere Commerce instance.
|
java.lang.String | getInterfaceName()
This method gets the interface name of the task command which will determine whether the job needs to be executed.
|
protected java.lang.Integer | getInterval()
This method gets the interval between each run of the job.
|
java.lang.Long | getJobId()
This method gets the job's reference number.
|
java.lang.Long | getJobInstanceId()
This method gets the job's instance number.
|
protected java.lang.String | getName()
This method gets the user identity of the job.
|
protected java.lang.String | getPathInfo()
This method gets the command name of the job to execute.
|
protected java.lang.Integer | getPriority()
This method gets the priority of the job.
|
protected java.lang.String | getQueryString()
This method gets the parameters when executing the job.
|
AccessVector | getResources()
This method gets the resources when creating the schedule job.
|
protected java.lang.Integer | getSequence()
This method gets the sequence of the schedule job.
|
protected java.sql.Timestamp | getStartTime()
This method gets the preferred start time for executing the schedule job.
|
java.lang.Integer | getStoreId()
This method gets the store for which this schedule job will run.
|
protected java.lang.String | getStringEndTime()
This method gets a String object that represents the end time.
|
protected java.lang.String | getStringStartTime()
This method gets a String object that represents the start time.
|
protected java.lang.String | getUrl()
This method gets the URL to which we should be redirected at the end of the command.
|
java.lang.Long | getUserRefNum()
This method gets the user reference number of the user identity of the scheduler job.
|
void | performExecute()
This method adds a new schedule job to the Commerce's Scheduler.
|
void | setApplicationType(java.lang.String applicationType)
This method sets the job's application type.
|
void | setAttempts(java.lang.Integer attempts)
This method sets the number of retry attempts.
|
void | setCheckCommandId(java.lang.Integer chkCmdId)
This method sets the id of the check command defined in the CHKCMD table.
|
void | setDelay(java.lang.Integer delay)
This method sets the delay time between re-attempts.
|
void | setEndTime(java.sql.Timestamp endTime)
This method sets the end time of the job.
|
void | setErrorUrl(java.lang.String url)
This method sets the URL to be redirected to at the end of the command.
|
void | setHost(java.lang.String host)
This method sets the name of the scheduler instance that should run the schedule job.
|
void | setInterfaceName(java.lang.String interfaceName)
This method sets the interface name of the task command which will determine whether the job needs executing or not.
|
void | setInterval(java.lang.Integer interval)
This method sets the frequency to re-execute the schedule job.
|
void | setJobId(java.lang.Long newJobId)
This method sets the job id.
|
void | setJobInfo(TypedProperty property)
This method sets the job information and adds the new schedule job.
|
void | setName(java.lang.String name)
This method sets the user identity to run the schedule job.
|
void | setPathInfo(java.lang.String command)
This method sets the name of the command to be added to the scheduler.
|
void | setPriority(java.lang.Integer priority)
This method sets the priority of the job.
|
void | setQueryString(java.lang.String parameters)
This method sets the query string associated with the job.
|
void | setRequestProperties(TypedProperty reqParms)
This method extracts the required parameters from the request properties and sets it locally in the command.
|
void | setSequence(java.lang.Integer policy)
This method sets the sequence.
|
void | setStartTime(java.sql.Timestamp startTime)
This method sets the start time to execute the schedule job.
|
void | setStoreId(java.lang.Integer storeId)
This method sets the store id of the schedule job.
|
void | setStringEndTime(java.lang.String endTime)
This method sets the job's end time.
|
void | setStringStartTime(java.lang.String startTime)
This method sets the job's start time.
|
void | setUrl(java.lang.String url)
This method sets the URL to be redirected to at the end of the command.
|
void | setUserRefNum(java.lang.Long refnum)
This method sets the user reference number that represents the job's user identity.
|
void | validateParameters()
This method checks the validity of the parameters.
|
public static final java.lang.String COPYRIGHT
public AddJobCmdImpl()
protected static java.sql.Timestamp convertTime(java.lang.String time) throws ECException
public java.lang.String getApplicationType()
public java.lang.Integer getAttempts()
public java.lang.Integer getCheckCommandId()
public java.lang.Integer getDelay()
protected java.lang.String getEndTime()
protected java.lang.String getErrorUrl()
public java.lang.String getHost()
public java.lang.String getInterfaceName()
protected java.lang.Integer getInterval()
public java.lang.Long getJobId()
public java.lang.Long getJobInstanceId()
protected java.lang.String getName()
protected java.lang.String getPathInfo()
protected java.lang.Integer getPriority()
protected java.lang.String getQueryString()
public AccessVector getResources() throws ECException
protected java.lang.Integer getSequence()
protected java.sql.Timestamp getStartTime()
public java.lang.Integer getStoreId()
protected java.lang.String getStringEndTime()
protected java.lang.String getStringStartTime()
protected java.lang.String getUrl()
public java.lang.Long getUserRefNum()
public void performExecute() throws ECException
This method adds a new schedule job to the Commerce's Scheduler. This is done by adding a record to the SCHCONFIG table and SCHACTIVE table. The entry in the SCHCONFIG table will contain the configuration for executing the job. The record in the SCHACTIVE table will contain the information when to execute the job. After the two records are created, the local Commerce scheduler will be notified that a new job was added. This is done in case it needs to wake up earlier to process the newly added job.
The response properties will contain the required information to redirect to the specified URL.
public void setApplicationType(java.lang.String applicationType)
public void setAttempts(java.lang.Integer attempts)
public void setCheckCommandId(java.lang.Integer chkCmdId)
public void setDelay(java.lang.Integer delay)
public void setEndTime(java.sql.Timestamp endTime)
public void setErrorUrl(java.lang.String url)
public void setHost(java.lang.String host)
public void setInterfaceName(java.lang.String interfaceName)
public void setInterval(java.lang.Integer interval)
public void setJobId(java.lang.Long newJobId)
public void setJobInfo(TypedProperty property) throws ECException
public void setName(java.lang.String name)
public void setPathInfo(java.lang.String command)
public void setPriority(java.lang.Integer priority)
public void setQueryString(java.lang.String parameters)
public void setRequestProperties(TypedProperty reqParms) throws ECException
public void setSequence(java.lang.Integer policy)
public void setStartTime(java.sql.Timestamp startTime)
public void setStoreId(java.lang.Integer storeId)
public void setStringEndTime(java.lang.String endTime)
public void setStringStartTime(java.lang.String startTime)
public void setUrl(java.lang.String url)
public void setUserRefNum(java.lang.Long refnum)
public void validateParameters() throws ECException