com.ibm.commerce.scheduler.commands

Class CleanJobCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, CleanJobCmd, com.ibm.commerce.scheduler.OmitSchedulerJobId, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    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.

    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

      • CleanJobCmdImpl

        public CleanJobCmdImpl()
        This is the default constructor for this class. It calls the constructor from the superclass.
    • Method Detail

      • getEndTime

        public java.sql.Timestamp getEndTime()
        Gets the end time of the job status to clean.
        Returns:
        The end time of the job status to clean.
      • performExecute

        public void performExecute()
                            throws ECException
        Find all the status records for the specified job that is completed and has an end time less before the specified value. Then delete those records. The status of the job is either found in the SCHSTATUS or SCHBRDCST table. Note, if no job is specified that all job status will be cleared that is completed and has an end time before the specified time.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - if there is a problem removing or finding the job status records.
      • setEndTime

        public void setEndTime(java.sql.Timestamp endTime)
        Sets the time value which indicates the status records that should be deleted.
        Parameters:
        endTime - the greatest time of the status records to delete.
      • setJobRefNum

        public void setJobRefNum(java.lang.Long jobrefnum)
        Sets the job reference number for the job to be removed.
        Parameters:
        jobrefnum - the job to clean.
      • setStringEndTime

        public void setStringEndTime(java.lang.String endTime)
        Sets the time criteria used to clean job status entries.
        Parameters:
        endTime - the time criteria.
      • setUrl

        public void setUrl(java.lang.String url)
        Sets the URL to be redirected to at the end of the command.
        Parameters:
        url - the URL to redirect to.