public class CleanJobCmdImpl extends ControllerCommandImpl implements CleanJobCmd
This class removes job entries from scheduler status table if the job entry is completed.
The command exceptions the following parameters:
URL
(optional): This is the URL to which we should be redirected after the command is executed.
endTime
(required): This is the time criteria used to specified which status should be removed. There
are two keys that can be used. They are LASTMONTH
and LASTWEEK
.
LASTMONTH
will automatically be translated to a date which is exactly one month
ago and LASTWEEK
will automatically be translated to a date which is exactly
one week ago.
jobId
(optional): This is the job reference number of the job. If no job is specified then the status of each job is removed.
This command first verifies the values specified. Once the parameters are verified
the status in the SCHSTATUS
and SCHBRDCST
tables that have an end time that is
before the specified end time are removed. If a job number is specified, or the job status is
removed and no job number is specified, then each job status will be removed. The response
properties will contain the appropriate information to redirect to the specified URL(if specified) after
execution.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright notice field.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
CleanJobCmdImpl()
This is the default constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Timestamp |
getEndTime()
Gets the end time of the job status to clean.
|
AccessVector |
getResources()
Returns the store the owns the job to be cleaned.
|
void |
performExecute()
Find all the status records for the specified job that is completed and has an end time less before the specified value.
|
void |
setEndTime(java.sql.Timestamp endTime)
Sets the time value which indicates the status records that should be deleted.
|
void |
setJobRefNum(java.lang.Long jobrefnum)
Sets the job reference number for the job to be removed.
|
void |
setRequestProperties(TypedProperty reqParms)
This method extracts the required parameters from the request properties and
sets it locally in the command.
|
void |
setStringEndTime(java.lang.String endTime)
Sets the time criteria used to clean job status entries.
|
void |
setUrl(java.lang.String url)
Sets the URL to be redirected to at the end of the command.
|
void |
validateParameters()
Validates the parameters passed to the command.
|
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
fulfills, getOwner
public static final java.lang.String COPYRIGHT
public CleanJobCmdImpl()
public java.sql.Timestamp getEndTime()
public AccessVector getResources() throws ECException
getResources
in interface ECCommand
getResources
in class AbstractECTargetableCommand
ECException
- if there is a problem obtaining the store id of the job.public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
- if there is a problem removing or finding the job status records.public void setEndTime(java.sql.Timestamp endTime)
endTime
- the greatest time of the status records to delete.public void setJobRefNum(java.lang.Long jobrefnum)
jobrefnum
- the job to clean.public void setRequestProperties(TypedProperty reqParms) throws ECApplicationException
setRequestProperties
in interface ControllerCommand
setRequestProperties
in class ControllerCommandImpl
reqParms
- the parameters of the command.ECApplicationException
- if there was an invalid or missing parameter.public void setStringEndTime(java.lang.String endTime)
endTime
- the time criteria.public void setUrl(java.lang.String url)
url
- the URL to redirect to.public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECTargetableCommand
ECException
- if a required parameter is missing or a specified parameter is invalid.