Package com.redwood.scheduler.api.model
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.)
-
-
Field Summary
-
Fields inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
ACTION_AUDIT, ACTION_EXPORT, ACTION_READ, BEHAVIOR_DEPRECATED, BEHAVIOR_NONE, BEHAVIOR_SYSTEM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HandlerAction
getAction()
Get the value for Action.JobChainStep
getGotoStepJobChainStep()
Get the GotoStepJobChainStep.String
getMessage()
Get the value for Message.Long
getReturnCode()
Get the value for ReturnCode.Long
getSequenceNumber()
Get the value for SequenceNumber.JobStatus
getStatus()
Get the value for Status.void
setAction(HandlerAction newAction)
Set the value for Action.void
setGotoStepJobChainStep(JobChainStep newGotoStepJobChainStep)
Set the value for GotoStepJobChainStep.void
setMessage(String newMessage)
Set the value for Message.void
setReturnCode(Long newReturnCode)
Set the value for ReturnCode.void
setSequenceNumber(Long newSequenceNumber)
Set the value for SequenceNumber.void
setStatus(JobStatus newStatus)
Set the value for Status.-
Methods inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
canPerform, createSubjectObjectPrivilegeGrant, deleteObject, getAuditTrail, getAuditTrailSize, getBehavior, getEffectiveBehavior, getErrorNameEN, getErrorNameKey, getLLPVersion, getLOV, getLOVSupport, getObjectType, getParentSchedulerEntities, getRuntime, getSubjectObjectPrivilegeGrantBySubject, getSubjectObjectPrivilegeGrants, getUniqueId, getUrl, getUrl, isCreated, isDeletable, isDeleted, isModifiable, isModified, isSelectVersioned, processRelatedObjects, processRelatedObjects, processRelatedObjects, refreshObject, resetObject, resetObject, resetValuesToDefault, selectForRead
-
-
-
-
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 benull
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 benull
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 isnull
, 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 isnull
, 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.
-
-