Interface StatusHandler

  • All Superinterfaces:
    Detail, SchedulerEntity, SchedulerEntityComp
    All Known Subinterfaces:
    JobChainStatusHandler, JobChainStepStatusHandler

    public interface StatusHandler
    extends Detail
    A status handler defines the behavior of the job chain after each step is completed. A status handler defined at job chain level acts as default for all steps. A job chain status-handler is overruled by the step if the step has a status handler defined for the same status. A status handler is triggered when one or more calls in a step or in the job chain finish with a specific job status. The following job states can be used for status-handlers: COMPLETED: All calls in the step or in the job chain must be completed successfully before this status handler is activated; KILLED, CANCELED, ERROR, UNKNOWN: If any call in the step or in the job chain has the corresponding job status this status handler will be activated. OTHERWISE: this status-handler is activated if none of the others apply. You can set a status handler for the situation that the step is disabled by a pre-condition by using the OTHERWISE status. The following actions can be specified: GOTO_STEP - Go to another step within the job chain; RAISE_ERROR - Raise an error and set a return code and error message; MARK_COMPLETED - On step level finish this step and set the step status to COMPLETED, on job chain level finish the job chain and set the job chain status to COMPLETED; (Note that when used with a status handler for ERROR in a step, the step is remains in ERROR but the chain is set to COMPLETED.) RESTART - Restart the job chain; CONSOLE RESTART - Request restart by sending a message to the Messages monitor. The job chain is restarted only after a positive reply to the message 'Restart Y/N'. While waiting for the reply the job chain gets the status CONSOLE. If a positive reply is given, the job chain is restarted just like a plain RESTART. (The step or job chain is not restarted if a negative reply is given.) A job chain waiting with a CONSOLE status react upon a jcs.operator_error as if the restart reply was 'N'. CONTINUE -Ignore any failures and continue with the next step. IGNORE_JOBCHAIN_DEFAULT - Ignore the default status handler that is set for the corresponding status at job chain level. (This action can only be used on step level.)
    • Method Detail

      • getAction

        HandlerAction getAction()
        Get the value for Action. (What to do if this StatusHandler matches.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMessage

        String getMessage()
        Get the value for Message. (Message to be used when this handler is acted upon.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getReturnCode

        Long getReturnCode()
        Get the value for ReturnCode. (Return code to be returned for a status handler with a RAISE_ERROR action.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getSequenceNumber

        Long getSequenceNumber()
        Get the value for SequenceNumber. (The status handler sequence number) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getStatus

        JobStatus getStatus()
        Get the value for Status. (Status of the step that the status handler will activate upon, or null to represent 'OTHERWISE'.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setAction

        void setAction​(HandlerAction newAction)
        Set the value for Action. (What to do if this StatusHandler matches.) This value is mandatory.
        Parameters:
        newAction - the new value for Action. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMessage

        void setMessage​(String newMessage)
        Set the value for Message. (Message to be used when this handler is acted upon.) This value is optional.
        Parameters:
        newMessage - the new value for Message.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setReturnCode

        void setReturnCode​(Long newReturnCode)
        Set the value for ReturnCode. (Return code to be returned for a status handler with a RAISE_ERROR action.) This value is optional.
        Parameters:
        newReturnCode - the new value for ReturnCode.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setSequenceNumber

        void setSequenceNumber​(Long newSequenceNumber)
        Set the value for SequenceNumber. (The status handler sequence number) This value is mandatory.
        Parameters:
        newSequenceNumber - the new value for SequenceNumber. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setStatus

        void setStatus​(JobStatus newStatus)
        Set the value for Status. (Status of the step that the status handler will activate upon, or null to represent 'OTHERWISE'.) This value is optional.
        Parameters:
        newStatus - the new value for Status.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getGotoStepJobChainStep

        JobChainStep getGotoStepJobChainStep()
        Get the GotoStepJobChainStep.
        Returns:
        GotoStepJobChainStep
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • setGotoStepJobChainStep

        void setGotoStepJobChainStep​(JobChainStep newGotoStepJobChainStep)
        Set the value for GotoStepJobChainStep. This value is optional.
        Parameters:
        newGotoStepJobChainStep - is the object to set GotoStepJobChainStep to. The step to go to as the result of evaluating a final status handler.