org.jclouds.compute.callables
Class RunScriptOnNodeUsingSsh
java.lang.Object
org.jclouds.compute.callables.RunScriptOnNodeUsingSsh
- All Implemented Interfaces:
- Callable<ExecResponse>, RunScriptOnNode
public class RunScriptOnNodeUsingSsh
- extends Object
- implements RunScriptOnNode
- Author:
- Adrian Cole
MARKER
public static final String MARKER
- See Also:
- Constant Field Values
logger
@Named(value="jclouds.compute")
protected Logger logger
sshFactory
protected final com.google.common.base.Function<NodeMetadata,SshClient> sshFactory
node
protected final NodeMetadata node
statement
protected final Statement statement
runAsRoot
protected final boolean runAsRoot
ssh
protected SshClient ssh
RunScriptOnNodeUsingSsh
public RunScriptOnNodeUsingSsh(com.google.common.base.Function<NodeMetadata,SshClient> sshFactory,
NodeMetadata node,
Statement statement,
RunScriptOptions options)
call
public ExecResponse call()
- Description copied from interface:
RunScriptOnNode
- Note that
RunScriptOnNode.init()
must be called first.
- Specified by:
call
in interface Callable<ExecResponse>
- Specified by:
call
in interface RunScriptOnNode
init
public RunScriptOnNode init()
- Description copied from interface:
RunScriptOnNode
- verifies that the command can execute on the node. For example, if this is ssh, it may attempt
to find a reachable socket. If this is using an API, it may attempt to validate that
connection.
- Specified by:
init
in interface RunScriptOnNode
runCommand
protected ExecResponse runCommand(String command)
execAsRoot
public String execAsRoot(String command)
execScriptAsDefaultUser
protected String execScriptAsDefaultUser(String command)
getNode
public NodeMetadata getNode()
- Description copied from interface:
RunScriptOnNode
- the node this command is being executed on.
- Specified by:
getNode
in interface RunScriptOnNode
toString
public String toString()
- Overrides:
toString
in class Object
getStatement
public Statement getStatement()
- Specified by:
getStatement
in interface RunScriptOnNode
- Returns:
- statement that will be executed
Copyright © 2009-2011 jclouds. All Rights Reserved.