public class ClusterCommandHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ClusterCommandHelper.ReportResult |
Constructor and Description |
---|
ClusterCommandHelper(Domain domain,
CommandRunner runner)
Construct a ClusterCommandHelper
|
Modifier and Type | Method and Description |
---|---|
List<Server> |
optimizeServerListOrder(List<Server> original)
Optimize the order of the list of servers.
|
ActionReport |
runCommand(String command,
ParameterMap map,
String targetName,
AdminCommandContext context,
boolean verbose)
Loop through all instances in a cluster and execute a command for each one.
|
ActionReport |
runCommand(String command,
ParameterMap map,
String targetName,
AdminCommandContext context,
boolean verbose,
boolean rolling)
Loop through all instances in a cluster and execute a command for each one.
|
public ClusterCommandHelper(Domain domain, CommandRunner runner)
domain
- The Domain we are running inrunner
- A CommandRunner to use for running commandspublic ActionReport runCommand(String command, ParameterMap map, String targetName, AdminCommandContext context, boolean verbose) throws CommandException
command
- The string of the command to run. The instance name will be used as the operand for the command.map
- A map of parameters to use for the command. May be null if no parameters. When the command is executed for
a server instance, the instance name is set as the DEFAULT parameter (operand)targetName
- The name of the cluster or deployment group containing the instances to run the command against.context
- The AdminCommandContext to use when executing the command.verbose
- true for more verbose outputCommandException
public ActionReport runCommand(String command, ParameterMap map, String targetName, AdminCommandContext context, boolean verbose, boolean rolling) throws CommandException
command
- The string of the command to run. The instance name will be used as the operand for the command.map
- A map of parameters to use for the command. May be null if no parameters. When the command is executed for
a server instance, the instance name is set as the DEFAULT parameter (operand)targetName
- The name of the cluster or deployment group containing the instances to run the command against.context
- The AdminCommandContext to use when executing the command.verbose
- true for more verbose outputrolling
- Whether calls should be serialized to help with rolling restartsCommandException
public List<Server> optimizeServerListOrder(List<Server> original)
original
- a list of serversCopyright © 2019. All rights reserved.