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:

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.
 
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. EditJobCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.scheduler.commands. AddJobCmd
defaultCommandClassName, NAME
 
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. 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, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM Copyright notice field.
See Also:
Constant Field Values
Constructor Detail

EditJobCmdImpl

public EditJobCmdImpl()
Creates the EditJob command object.
Method Detail

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.

performExecute

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.