com.ibm.commerce.scheduler.commands
Class AddJobCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.scheduler.commands.AddJobCmdImpl
All Implemented Interfaces:
AccCommand, AddJobCmd, ControllerCommand, ECCommand, ECTargetableCommand, Protectable
Direct Known Subclasses:
AddBroadcastJobCmdImpl, ContractDeployCmdImpl, EditJobCmdImpl

public class AddJobCmdImpl
extends ControllerCommandImpl
implements AddJobCmd

Add a job to scheduler table.


Field Summary
static java.lang.String COPYRIGHT
           
 
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()
          AddJobCmdImpl constructor.
 
Method Summary
protected static java.sql.Timestamp convertTime(java.lang.String time)
          Convert the input time value to a Timestamp.
 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 host name.
 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 url to be redirected to at the end of the command.
 java.lang.String getHost()
          Gets the host name.
 java.lang.String getInterfaceName()
          Gets the host name.
protected  java.lang.Integer getInterval()
          Gets the interval between each run of the job.
 java.lang.Long getJobId()
          Gets the job id.
 java.lang.Long getJobInstanceId()
          Gets the job instance id.
protected  java.lang.String getName()
          Sets the user name.
protected  java.lang.String getPathInfo()
          Gets the command name.
protected  java.lang.Integer getPriority()
          Gets the priority.
protected  java.lang.String getQueryString()
          Gets the query string.
 AccessVector getResources()
          Returns the resource for the command.
protected  java.lang.Integer getSequence()
          Gets the sequence.
protected  java.sql.Timestamp getStartTime()
          Gets the timestamp for the preferred start time for the request.
 java.lang.Integer getStoreId()
          Gets the host name.
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.
 void performExecute()
          This is the real function part of the AddJob command - add a entry in scheduler config table and scheduler status table.
 void setApplicationType(java.lang.String ApplicationType)
          Sets the application type.
 void setAttempts(java.lang.Integer attempts)
          Sets the number of retry attempts.
 void setCheckCommandId(java.lang.Integer chkCmdId)
          Sets the sequence.
 void setDelay(java.lang.Integer delay)
          Sets the delay time between re-attempts.
 void setEndTime(java.sql.Timestamp endTime)
          Sets the timestamp value for the end time.
 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 host where command should be run.
 void setInterfaceName(java.lang.String interfaceName)
          Sets the frquency to rerun of this job.
 void setInterval(java.lang.Integer interval)
          Sets the frquency to rerun of this job.
 void setJobId(java.lang.Long newJobId)
          Sets the job id.
 void setJobInfo(TypedProperty property)
          Sets the job information.
 void setName(java.lang.String name)
          Sets the name of user.
 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.
 void setStoreId(java.lang.Integer storeId)
          Sets the sequence.
 void setStringEndTime(java.lang.String endTime)
          Sets the string value for the end time.
 void setStringStartTime(java.lang.String startTime)
          Sets the start time in string.
 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 Id.
 void validateParameters()
          Checks the validity of the parameters.
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
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, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

AddJobCmdImpl

public AddJobCmdImpl()
AddJobCmdImpl constructor.
Method Detail

convertTime

protected static java.sql.Timestamp convertTime(java.lang.String time)
                                         throws ECException
Convert the input time value to a Timestamp.

Parameters:
time - String - input time value
Returns:
Timestamp

getApplicationType

public java.lang.String getApplicationType()
Gets the application type for the job to be added.
Returns:
String

getAttempts

public java.lang.Integer getAttempts()
Gets the number of re-attempts when error occurs.
Returns:
Integer

getCheckCommandId

public java.lang.Integer getCheckCommandId()
Gets the host name.

Returns:
String

getDelay

public java.lang.Integer getDelay()
Gets the delay time between re-attempts when error occurs.

Returns:
Integer

getEndTime

protected java.lang.String getEndTime()
Gets the timestamp for the end time for the request.

Returns:
Timestamp - end time timestamp

getErrorUrl

protected java.lang.String getErrorUrl()
Gets the url to be redirected to at the end of the command.

Returns:
String - url

getHost

public java.lang.String getHost()
Gets the host name.

Returns:
String

getInterfaceName

public java.lang.String getInterfaceName()
Gets the host name.

Returns:
String

getInterval

protected java.lang.Integer getInterval()
Gets the interval between each run of the job.

Returns:
Integer

getJobId

public java.lang.Long getJobId()
Gets the job id.

Specified by:
getJobId in interface AddJobCmd
Returns:
Long

getJobInstanceId

public java.lang.Long getJobInstanceId()
Gets the job instance id.

Specified by:
getJobInstanceId in interface AddJobCmd
Returns:
Long

getName

protected java.lang.String getName()
Sets the user name.

getPathInfo

protected java.lang.String getPathInfo()
Gets the command name.

getPriority

protected java.lang.Integer getPriority()
Gets the priority.

getQueryString

protected java.lang.String getQueryString()
Gets the query string.

getResources

public AccessVector getResources()
                          throws ECException
Returns the resource for the command.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
com.ibm.commerce.accesscontrol.AccessVector
Throws:
ECException - The exception description.

getSequence

protected java.lang.Integer getSequence()
Gets the sequence.

getStartTime

protected java.sql.Timestamp getStartTime()
Gets the timestamp for the preferred start time for the request.

Returns:
Timestamp - start time timestamp

getStoreId

public java.lang.Integer getStoreId()
Gets the host name.

Specified by:
getStoreId in interface ECCommand
Overrides:
getStoreId in class AbstractECTargetableCommand
Returns:
String

getStringEndTime

protected java.lang.String getStringEndTime()
Gets the string value for the end time.

Returns:
String - end time value

getStringStartTime

protected java.lang.String getStringStartTime()
Gets the string value for the start time.

Returns:
String - start time value

getUrl

protected java.lang.String getUrl()
Gets the url to be redirected to at the end of the command.

Returns:
String - url

getUserRefNum

public java.lang.Long getUserRefNum()
Gets the user reference number.

performExecute

public void performExecute()
                    throws ECException
This is the real function part of the AddJob command - add a entry in scheduler config table and scheduler status table.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

setApplicationType

public void setApplicationType(java.lang.String ApplicationType)
Sets the application type.
Specified by:
setApplicationType in interface AddJobCmd

setAttempts

public void setAttempts(java.lang.Integer attempts)
Sets the number of retry attempts.
Specified by:
setAttempts in interface AddJobCmd

setCheckCommandId

public void setCheckCommandId(java.lang.Integer chkCmdId)
Sets the sequence. The policy for handling missed runs. The default is 0, meaning that missed job will all be skipped except for one.

Parameters:
policy - Integer

setDelay

public void setDelay(java.lang.Integer delay)
Sets the delay time between re-attempts.
Specified by:
setDelay in interface AddJobCmd

setEndTime

public void setEndTime(java.sql.Timestamp endTime)
Sets the timestamp value for the end time.

Parameters:
endtime - Timestamp - end time value

setErrorUrl

public void setErrorUrl(java.lang.String url)
Sets the url to be redirected to at the end of the command.

Parameters:
url - String - url

setHost

public void setHost(java.lang.String host)
Sets the name of the host where command should be run.
Specified by:
setHost in interface AddJobCmd

setInterfaceName

public void setInterfaceName(java.lang.String interfaceName)
Sets the frquency to rerun of this job.
Parameters:
interval - Integer - interval in units of seconds.

setInterval

public void setInterval(java.lang.Integer interval)
Sets the frquency to rerun of this job.
Specified by:
setInterval in interface AddJobCmd
Parameters:
interval - Integer - interval in units of seconds.

setJobId

public void setJobId(java.lang.Long newJobId)
Sets the job id.

setJobInfo

public void setJobInfo(TypedProperty property)
                throws ECException
Sets the job information.

Parameters:
property - TypedProperty

setName

public void setName(java.lang.String name)
Sets the name of user.
Specified by:
setName in interface AddJobCmd

setPathInfo

public void setPathInfo(java.lang.String command)
Sets the name of the command to be added to the scheduler.
Specified by:
setPathInfo in interface AddJobCmd

setPriority

public void setPriority(java.lang.Integer priority)
Sets the priority of the job.

setQueryString

public void setQueryString(java.lang.String parameters)
Sets the query string associated with the job.
Specified by:
setQueryString in interface AddJobCmd

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 ControllerCommandImpl
Parameters:
reqParms - com.ibm.commerce.datatype.TypedProperty
Throws:
ECApplicationException -  

setSequence

public void setSequence(java.lang.Integer policy)
Sets the sequence. The policy for handling missed runs. The default is 0, meaning that missed job will all be skipped except for one.

Specified by:
setSequence in interface AddJobCmd
Parameters:
policy - Integer

setStartTime

public void setStartTime(java.sql.Timestamp startTime)
Sets the start time.

Specified by:
setStartTime in interface AddJobCmd
Parameters:
startTiem - Timestamp

setStoreId

public void setStoreId(java.lang.Integer storeId)
Sets the sequence. The policy for handling missed runs. The default is 0, meaning that missed job will all be skipped except for one.

Parameters:
policy - Integer

setStringEndTime

public void setStringEndTime(java.lang.String endTime)
Sets the string value for the end time.

Parameters:
endtimeString - - end time value

setStringStartTime

public void setStringStartTime(java.lang.String startTime)
Sets the start time in string.

Parameters:
startTiem - String

setUrl

public void setUrl(java.lang.String url)
Sets the url to be redirected to at the end of the command.

Specified by:
setUrl in interface AddJobCmd
Parameters:
url - String - url

setUserRefNum

public void setUserRefNum(java.lang.Long refnum)
Sets the user Id.

Specified by:
setUserRefNum in interface AddJobCmd
Parameters:
Long -  

validateParameters

public void validateParameters()
                        throws ECException
Checks the validity of the parameters. It checks for the presence or absence of parameters and the range of values.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException -