Class Action<O,R>
- java.lang.Object
-
- com.evolveum.midpoint.ninja.action.Action<O,R>
-
- Type Parameters:
O
- options class
- Direct Known Subclasses:
DownloadDistributionAction
,HelpAction
,ListKeysRepositoryAction
,PreUpgradeCheckAction
,RepositoryAction
,RunSqlAction
,UpgradeBaseAction
,UpgradeInstallationAction
public abstract class Action<O,R> extends Object
Base implementation class for action, that is Ninja command.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
destroy()
abstract R
execute()
@NotNull NinjaApplicationContextLevel
getApplicationContextLevel(List<Object> allOptions)
LogTarget
getLogTarget()
abstract String
getOperationName()
protected void
handleResultOnFinish(R consumerResult, OperationStatus operation, String finishMessage)
void
init(NinjaContext context, O options)
-
-
-
Field Detail
-
partial
protected final boolean partial
Flag, whether action is part of more complex action. This is most often used to determine whether and how to print information to user (or skip some, e.g. next steps messages).
-
log
protected Log log
-
context
protected NinjaContext context
-
options
protected O options
-
-
Method Detail
-
init
public void init(NinjaContext context, O options)
-
destroy
public void destroy()
-
getLogTarget
public LogTarget getLogTarget()
- Returns:
- target where the log should be printed. In case action result is printed to the standard output, log messages should go to the standard error no to mix the output. Otherwise, log messages should go to the standard output.
-
handleResultOnFinish
protected void handleResultOnFinish(R consumerResult, OperationStatus operation, String finishMessage)
-
getApplicationContextLevel
@NotNull public @NotNull NinjaApplicationContextLevel getApplicationContextLevel(List<Object> allOptions)
- Parameters:
allOptions
-- Returns:
- Level of application context initialization required for this action.
-
getOperationName
public abstract String getOperationName()
-
-