public class NodeRunner extends Object
Constructor and Description |
---|
NodeRunner(org.glassfish.hk2.api.ServiceLocator habitat,
Logger logger) |
Modifier and Type | Method and Description |
---|---|
String |
getLastCommandRun() |
boolean |
isDcomNode(Node node) |
boolean |
isSshNode(Node node) |
int |
runAdminCommandOnNode(Node node,
StringBuilder output,
boolean waitForReaderThreads,
List<String> args,
AdminCommandContext context) |
int |
runAdminCommandOnNode(Node node,
StringBuilder output,
List<String> args,
AdminCommandContext context)
Run an asadmin command on a Node.
|
public NodeRunner(org.glassfish.hk2.api.ServiceLocator habitat, Logger logger)
public String getLastCommandRun()
public boolean isSshNode(Node node)
public boolean isDcomNode(Node node)
public int runAdminCommandOnNode(Node node, StringBuilder output, List<String> args, AdminCommandContext context) throws SSHCommandExecutionException, ProcessManagerException, UnsupportedOperationException, IllegalArgumentException
node
- The node to run the asadmin command onoutput
- A StringBuilder to hold the command's output in. Both
stdout and stderr are placed in output. null if you
don't want the output.args
- The arguments to the asadmin command. This includes
parameters for asadmin (like --host) as well as the
command (like start-local-instance) as well as an
parameters for the command. It does not include the
string "asadmin" itself.SSHCommandExecutionException
- There was an error executing the
command via SSH.ProcessManagerException
- There was an error executing the
command locally.UnsupportedOperationException
- The command needs to be run on
a remote node, but the node is not
of type SSH.IllegalArgumentException
- The passed node is malformed.public int runAdminCommandOnNode(Node node, StringBuilder output, boolean waitForReaderThreads, List<String> args, AdminCommandContext context) throws SSHCommandExecutionException, ProcessManagerException, UnsupportedOperationException, IllegalArgumentException
Copyright © 2021. All rights reserved.