public final class Action
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Action |
callback(java.util.function.Function<ActionResult,Action> callback)
Create an
Action which causes the callback to be invoked. |
static Action |
error(java.lang.String statusMessage)
Create an
Action which indicates that an unrecoverable error has occurred and the scheduler must exit. |
static Action |
exit(java.lang.String statusMessage)
Create an
Action which indicates that the scheduler has reached the end of its life cycle gracefully |
java.util.function.Function<ActionResult,Action> |
getCallback() |
java.lang.String |
getProcedure() |
java.lang.Object[] |
getProcedureParameters() |
java.lang.String |
getStatusMessage() |
ActionType |
getType() |
static Action |
procedureCall(java.util.function.Function<ActionResult,Action> callback,
java.lang.String procedure,
java.lang.Object... procedureParameters)
Create an
Action which executes a procedure with given parameters |
Action |
setStatusMessage(java.lang.String statusMessage)
Set the optional status massage which will be reported in the statistics for a task and if this is an
ActionType.ERROR or ActionType.EXIT action then it will also be logged. |
java.lang.String |
toString() |
public static Action error(java.lang.String statusMessage)
Action
which indicates that an unrecoverable error has occurred and the scheduler must exit.
statusMessage
is the same status message which is set by calling setStatusMessage(String)
statusMessage
- To log indicating the details of the error. May be null
ActionType.ERROR
instance of Action
public static Action exit(java.lang.String statusMessage)
Action
which indicates that the scheduler has reached the end of its life cycle gracefully
statusMessage
is the same status message which is set by calling setStatusMessage(String)
statusMessage
- To log indicating the details of the error. May be null
ActionType.EXIT
instance of Action
public static Action procedureCall(java.util.function.Function<ActionResult,Action> callback, java.lang.String procedure, java.lang.Object... procedureParameters)
Action
which executes a procedure with given parameterscallback
- To be invoked after this procedure is executedprocedure
- Name of procedure to executeprocedureParameters
- That are passed to procedure for executionActionType.PROCEDURE
instance of Action
public static Action callback(java.util.function.Function<ActionResult,Action> callback)
Action
which causes the callback
to be invoked. An ActionResult
will be
associated with this call however it will have a null
procedure
and result
.callback
- To be invoked for this actionActionType.CALLBACK
instance of Action
public Action setStatusMessage(java.lang.String statusMessage)
ActionType.ERROR
or ActionType.EXIT
action then it will also be logged. For
ActionType.ERROR
or ActionType.EXIT
actions this can be provided as part of the factory method.statusMessage
- To be reportedthis
public java.util.function.Function<ActionResult,Action> getCallback()
null
if the type of
action is a stop actionpublic java.lang.String toString()
public ActionType getType()
ActionType
of this actionpublic java.lang.String getStatusMessage()
public java.lang.String getProcedure()
null
if this is not a ActionType.PROCEDURE
public java.lang.Object[] getProcedureParameters()
getProcedure()