com.ibm.commerce.scheduler.commands
Class EditJobCmdImpl
java.lang.Object
|
+--CacheableCommandImpl
|
+--com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.scheduler.commands.AddJobCmdImpl
|
+--com.ibm.commerce.scheduler.commands.EditJobCmdImpl
- All Implemented Interfaces:
-
AccCommand,
AddJobCmd,
ControllerCommand,
ECCommand,
ECTargetableCommand,
EditJobCmd
- public class EditJobCmdImpl
- extends
AddJobCmdImpl
- implements
EditJobCmd
Edits the configuration or next start time of an existing schedule job.
The parameters passed to the command are:
- jobId (required): the schedule job to edit.
- URL (required): the URL to redirect to after the command finished
executing.
- pathInfo (optional): the name of the command that the schedule job should
execute.
- start (optional): when to start executing the job.
- name (optional): the logon id of the job's user identity.
- queryString (optional): the parameters when executing the job. This will be
in the form of a URL query string, where a value of n1=v1 represents parameter
n1 will have a value of v1 when the job is executing.
- host (optional): the scheduler instance that should execute the job. Each
scheduler instance can have a unique instance name (by default it is the
Commerce Server web server host name) and a schedule job can run on a
particular scheduler instance if specified.
- interval (optional): the time (in seconds) the the job should be
re-executed. The value of the interval must be greater than or equal to 0.
- attempts (optional): the number of attempts to execute the job
successfully. The value specified must be greater than or equal to 0. If this
parameter is specified, then the delay parameter should be specified as
well.
- delay (optional): the time (in seconds) to wait before execute another
attempt of running the job successfully. This parameter must have a value
greater than or equal to 0 and if this parameter is specified, then the
attempts parameter must be specified as well.
- schedulerPolicy (optional): the policy of the job when it fails to be
executed. The other possible value of 1 means to retry to execute to job.
- priority (optional): the priority of the job. Valid values must be between
the range of
java.lang.Thread.MIN_PRIORITY
and
java.lang.Thread.MAX_PRIORITY
- applicationType (optional): the application type of the job. This is
defined in the scheduler instance configuration. The default application types
are default, broadcast, auction and inventory but others may be added.
- storeId (optional): the store identity of the job.
- checkCmdId (optional): the task command used to determine whether the job
needs to be executed or not.
This command retrieves the current configuration for the specified schedule
job. Then create a new schedule job based on the specified configuration and
using the old configuration value for those parameters that were not specified.
Then the original job is removed by calling the RemoveJob command. After the
execution of the command, the response properties will contain the information
need to redirect to the specified URL.
- See Also:
-
AddJobCmdImpl
, Serialized
Form
Field Summary |
static java.lang.String |
COPYRIGHT
IBM Copyright notice field. |
Constructor Summary |
EditJobCmdImpl()
Creates the EditJob command object. |
Method Summary |
AccessVector |
getResources()
Returns the resources for the EditJob command. |
void |
performExecute()
First the RemoveJob command is called to remove the current
job. |
void |
setRequestProperties(
TypedProperty reqParms)
This method extracts the required parameters from the request
properties and sets it locally in the command. |
void |
validateParameters()
Validates the specified parameters to the command and for those
parameters that were not specified, the values of the existing schedule job is
used. |
Methods inherited from class
com.ibm.commerce.scheduler.commands.
AddJobCmdImpl |
convertTime,
getApplicationType,
getAttempts,
getCheckCommandId,
getDelay,
getEndTime,
getErrorUrl,
getHost,
getInterfaceName,
getInterval,
getJobId,
getJobInstanceId,
getName,
getPathInfo,
getPriority,
getQueryString,
getSequence,
getStartTime,
getStoreId,
getStringEndTime,
getStringStartTime,
getUrl,
getUserRefNum,
setApplicationType,
setAttempts,
setCheckCommandId,
setDelay,
setEndTime,
setErrorUrl,
setHost,
setInterfaceName,
setInterval,
setJobId,
setJobInfo,
setName,
setPathInfo,
setPriority,
setQueryString,
setSequence,
setStartTime,
setStoreId,
setStringEndTime,
setStringStartTime,
setUrl,
setUserRefNum |
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.
ECCommand |
checkIsAllowed,
checkResourcePermission,
createCommandExecutionEvent,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getStoreId,
getUser,
getUserId,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- IBM Copyright notice field.
- See Also:
-
Constant Field Values
EditJobCmdImpl
public EditJobCmdImpl()
- Creates the EditJob command object.
getResources
public AccessVector getResources()
throws ECException
- Returns the resources for the EditJob command. The resources returned is
the store that the schedule job belongs to and the user identity the job will
execute under.
-
- Specified by:
-
getResources
in interface
ECCommand
- Overrides:
-
getResources
in class
AddJobCmdImpl
-
- Returns:
- An AccessVector object containing first the store the job belongs to and
then the user identity of the command. The user identity is only returned if it
differs from the current identity found in the command context.
- Throws:
-
ECException
- if there was a problem retrieve the schedule job's configuration from the
database.
public void performExecute()
throws ECException
- First the RemoveJob command is called to remove the current job. The
default implementation of the remove job is to only change the jobs
configuration to deactive the job and remove the SCHACTIVE record so it will
not be picked up. Then to add the new job, the super.validateParameters() is
called and then super.performExecute(). If there is a problem added the new
copy of the job, the remove job should rollback because they are part of the
same transaction.
-
- Specified by:
-
performExecute
in interface
ECCommand
- Overrides:
-
performExecute
in class
AddJobCmdImpl
-
- Throws:
-
ECException
- if there was a problem with calling the remove job command or calling the
methods of the super class.
setRequestProperties
public void setRequestProperties(TypedProperty reqParms)
throws ECException
- This method extracts the required parameters from the request properties
and sets it locally in the command. It throws an ECApplicationException if a
required parameter is missing.
-
- Specified by:
-
setRequestProperties
in interface
ControllerCommand
- Overrides:
-
setRequestProperties
in class
AddJobCmdImpl
-
- Parameters:
reqParms
- The parameters of the command.
- Throws:
-
ECException
- if there was a missing parameter.
validateParameters
public void validateParameters()
throws ECException
- Validates the specified parameters to the command and for those parameters
that were not specified, the values of the existing schedule job is used.
-
- Specified by:
-
validateParameters
in interface
ECCommand
- Overrides:
-
validateParameters
in class
AddJobCmdImpl
-
- Throws:
-
ECException
- if there is a problem with either the parameters specified or the retrieve of
the existing schedule job.