Package io.aeron.cluster
Class ClusterToolCommand
java.lang.Object
io.aeron.cluster.ClusterToolCommand
A command to be used by ClusterTool.
The command is an immutable representation of what to run (the Action), and the description for that action
(used in help).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface of a cluster tool operator action used inClusterToolCommand. -
Constructor Summary
ConstructorsConstructorDescriptionClusterToolCommand(ClusterToolCommand.Action action, String description) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaction()static ClusterToolCommand.Actionaction(ToIntBiFunction<File, PrintStream> actual) Convenience method for actions that do not require extra args.static ClusterToolCommand.Actionaction(ToIntFunction<File> actual) Convenience method for actions that only require the cluster directory.describe()static ClusterToolCommand.ActionConvenience method to ignore failure exit status.static voidprintHelp(Map<String, ClusterToolCommand> commands, String prefix) Print help for a tool with the specified commands.
-
Constructor Details
-
ClusterToolCommand
Constructor.- Parameters:
action- action to perform for command.description- description of command.
-
-
Method Details
-
ignoreFailures
Convenience method to ignore failure exit status.- Parameters:
actual- actual action.- Returns:
- SUCCESS
-
action
Convenience method for actions that do not require extra args.- Parameters:
actual- actual action.- Returns:
- SUCCESS
-
printHelp
Print help for a tool with the specified commands.- Parameters:
commands- map of commands by name.prefix- usage description prefix.
-
action
Convenience method for actions that only require the cluster directory.- Parameters:
actual- actual action.- Returns:
- SUCCESS.
-
describe
- Returns:
- description of command.
-
action
- Returns:
- the actual action to perform when given the command.
-