java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.ControllerCommandImpl | +--com.ibm.commerce.scheduler.commands.AddJobCmdImpl
Add a job to the Commance Server's scheduler.
The parameters passed to the command are:
java.lang.Thread.NORM_PRIORTY
. Valid values must be between the
range of java.lang.Thread.MIN_PRIORITY
and
java.lang.Thread.MAX_PRIORITY
The 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 table. The information found in the SCHCONFIG table contains the configuration information when executing the schedule job and the record in the SCHACTIVE record will determine when to execute the job next.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl |
requestProperties,
responseProperties,
retriable,
viewReqProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.scheduler.commands. AddJobCmd |
defaultCommandClassName,
NAME |
Constructor Summary | |
---|---|
AddJobCmdImpl() Creates the AddJob command object. |
Method Summary | |
---|---|
protected
static java.sql.Timestamp |
convertTime(java.lang.String time) Convert the input time value to a java.sql.Timestamp object. |
java.lang.String |
getApplicationType() Gets the application type for the job to be added. |
java.lang.Integer |
getAttempts() Gets the number of re-attempts when error occurs. |
java.lang.Integer |
getCheckCommandId() Gets the id of the check command. |
java.lang.Integer |
getDelay() Gets the delay time between re-attempts when error occurs. |
protected
java.lang.String |
getEndTime() Gets the timestamp for the end time for the request. |
protected
java.lang.String |
getErrorUrl() Gets the error URL to be redirected to at the end of the command in case of an error. |
java.lang.String |
getHost() Gets the scheduler instance name that unique identifies scheduler for a JVM of the Commerce instance. |
java.lang.String |
getInterfaceName() Gets the interface name of the task command with will determine whether the job needs to be executed. |
protected
java.lang.Integer |
getInterval() Gets the interval between each run of the job. |
java.lang.Long |
getJobId() Gets the job's reference number. |
java.lang.Long |
getJobInstanceId() Gets the job's instance number. |
protected
java.lang.String |
getName() Gets the user identity of the job. |
protected
java.lang.String |
getPathInfo() Gets the command name of the job to execute. |
protected
java.lang.Integer |
getPriority() Gets the priority of the job. |
protected
java.lang.String |
getQueryString() Gets the parameters when executing the job. |
AccessVector |
getResources() Returns the resources when creating the schedule job. |
protected
java.lang.Integer |
getSequence() Gets the sequence of the schedule job. |
protected
java.sql.Timestamp |
getStartTime() Gets the preferred start time for executing the schedule job. |
java.lang.Integer |
getStoreId() Gets the store which this schedule job will run for. |
protected
java.lang.String |
getStringEndTime() Gets the string value for the end time. |
protected
java.lang.String |
getStringStartTime() Gets the string value for the start time. |
protected
java.lang.String |
getUrl() Gets the URL to be redirected to at the end of the command. |
java.lang.Long |
getUserRefNum() Gets the user reference number of the user identity of the scheduler job. |
void |
performExecute() Adds a new schedule job to the Commerce's Scheduler. |
void |
setApplicationType(java.lang.String ApplicationType) Sets the job's application type. |
void |
setAttempts(java.lang.Integer attempts) Sets the number of retry attempts. |
void |
setCheckCommandId(java.lang.Integer chkCmdId) Sets the id of the check command defined in the CHKCMD table. |
void |
setDelay(java.lang.Integer delay) Sets the delay time between re-attempts. |
void |
setEndTime(java.sql.Timestamp endTime) Sets the end time of the job. |
void |
setErrorUrl(java.lang.String url) Sets the URL to be redirected to at the end of the command. |
void |
setHost(java.lang.String host) Sets the name of the scheduler instance that should run the schedule job. |
void |
setInterfaceName(java.lang.String interfaceName) Sets the interface name of the task command which will determine whether the job needs executing or not. |
void |
setInterval(java.lang.Integer interval) Sets the frequency to re-execute the schedule job. |
void |
setJobId(java.lang.Long newJobId) Sets the job id. |
void |
setJobInfo(
TypedProperty property) Sets the job information and adds the new schedule job. |
void |
setName(java.lang.String name) Sets the user identity to run the schedule job. |
void |
setPathInfo(java.lang.String command) Sets the name of the command to be added to the scheduler. |
void |
setPriority(java.lang.Integer priority) Sets the priority of the job. |
void |
setQueryString(java.lang.String parameters) 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) Sets the sequence. |
void |
setStartTime(java.sql.Timestamp startTime) Sets the start time to execute the schedule job. |
void |
setStoreId(java.lang.Integer storeId) Sets the store id of the schedule job. |
void |
setStringEndTime(java.lang.String endTime) Sets the job's end time. |
void |
setStringStartTime(java.lang.String startTime) Sets the job's start time. |
void |
setUrl(java.lang.String url) Sets the URL to be redirected to at the end of the command. |
void |
setUserRefNum(java.lang.Long refnum) Sets the user reference number that represents the job's user identity. |
void |
validateParameters() Checks the validity of the parameters. |
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl |
checkPermission,
fulfills,
getForUserId,
getGeneric,
getOwner,
getRequestProperties,
getResolvedRequestProperties,
getResourceOwners,
getResponseProperties,
getRetriable,
getViewInputProperties,
isGeneric,
isRetriable,
mergeProperties,
setForUserId,
setGeneric,
setOwner,
setResponseProperties,
setRetriable,
setViewInputProperties |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getUser,
getUserId,
isReadyToCallExecute,
reset,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.command. ControllerCommand |
checkPermission,
execute,
getGeneric,
getRequestProperties,
getResolvedRequestProperties,
getResponseProperties,
getRetriable,
getViewInputProperties,
isGeneric,
isRetriable,
mergeProperties,
setGeneric,
setRetriable,
setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command. AccCommand |
accessControlCheck,
getAccCheck,
getForUserId,
getResourceOwners,
setAccCheck,
setForUserId,
setOwner |
Methods inherited from interface com.ibm.commerce.command. ECCommand |
checkIsAllowed,
checkResourcePermission,
createCommandExecutionEvent,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getUser,
getUserId,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public AddJobCmdImpl()
Method Detail |
---|
protected static java.sql.Timestamp convertTime(java.lang.String time) throws ECException
time
- input time valuejava.sql.Timestamp
representation of the specified
time.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()
getJobId
in interface
AddJobCmd
public java.lang.Long getJobInstanceId()
getJobInstanceId
in interface
AddJobCmd
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
getResources
in interface
ECCommand
getResources
in class
AbstractECTargetableCommand
ECException
- if there is any problem obtaining the resources.protected java.lang.Integer getSequence()
protected java.sql.Timestamp getStartTime()
public java.lang.Integer getStoreId()
getStoreId
in interface
ECCommand
getStoreId
in class
AbstractECTargetableCommand
protected java.lang.String getStringEndTime()
java.lang.String
representation of the job's end
time.protected java.lang.String getStringStartTime()
java.lang.String
representation of the job's start
time.protected java.lang.String getUrl()
public java.lang.Long getUserRefNum()
public void performExecute() throws ECException
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 and 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 incase it may need wake up ealier to process the newly added job.
The response properties will contain the required information to redirect to the specified URL.
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
- If there are any problems adding the records to the scheduler tables or
notifying the scheduler about the newly added job.public void setApplicationType(java.lang.String ApplicationType)
setApplicationType
in interface
AddJobCmd
public void setAttempts(java.lang.Integer attempts)
setAttempts
in interface
AddJobCmd
attempts
- the number of attempts to successfully execute the
job.public void setCheckCommandId(java.lang.Integer chkCmdId)
chkCmdId
- the id of the check command.public void setDelay(java.lang.Integer delay)
setDelay
in interface
AddJobCmd
delay
- the delay in seconds before re-execute the job because
of a fail run.public void setEndTime(java.sql.Timestamp endTime)
public void setErrorUrl(java.lang.String url)
url
- the URL to redirect to.public void setHost(java.lang.String host)
setHost
in interface
AddJobCmd
host
- the name of the scheduler instance.public void setInterfaceName(java.lang.String interfaceName)
interfaceName
- the interface name of the check
command.public void setInterval(java.lang.Integer interval)
setInterval
in interface
AddJobCmd
interval
- the interval in seconds to wait before re-executing
the job. 0 means the job will only be executed once.public void setJobId(java.lang.Long newJobId)
newJobId
- the jobs id.public void setJobInfo(TypedProperty property) throws ECException
property
- the parameters when calling the AddJob
command.ECException
- if there is a problem with either the parameters passed to create the
schedule job or with the actual creation of the schedule
job.public void setName(java.lang.String name)
setName
in interface
AddJobCmd
name
- the logon id of the job's user
identity.public void setPathInfo(java.lang.String command)
setPathInfo
in interface
AddJobCmd
command
- the command to be executed.public void setPriority(java.lang.Integer priority)
priority
- the job's priority.public void setQueryString(java.lang.String parameters)
setQueryString
in interface
AddJobCmd
parameters
- the parameters passed to the command when
executing.public void setRequestProperties(TypedProperty reqParms) throws ECException
setRequestProperties
in interface
ControllerCommand
setRequestProperties
in class
ControllerCommandImpl
reqParms
- the parameters when executing the command.ECException
- if any parameters are missing.public void setSequence(java.lang.Integer policy)
setSequence
in interface
AddJobCmd
policy
- the job's sequence. This value should either be 0
or 1.public void setStartTime(java.sql.Timestamp startTime)
setStartTime
in interface
AddJobCmd
startTime
- the start time of the job.public void setStoreId(java.lang.Integer storeId)
storeId
- the id of the store to whose behalf the job will be
executed.public void setStringEndTime(java.lang.String endTime)
public void setStringStartTime(java.lang.String startTime)
startTime
- the job's start time.public void setUrl(java.lang.String url)
setUrl
in interface
AddJobCmd
url
- the URL to redirect to.public void setUserRefNum(java.lang.Long refnum)
setUserRefNum
in interface
AddJobCmd
refnum
- the user reference number.public void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException
- if either a require parameter was not specified or a specified parameter has
an invalid value.