org.jclouds.compute.callables
Class RunScriptOnNodeAsInitScriptUsingSsh
java.lang.Object
org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSsh
- All Implemented Interfaces:
- Callable<ExecResponse>, RunScriptOnNode
- Direct Known Subclasses:
- RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete
public class RunScriptOnNodeAsInitScriptUsingSsh
- extends Object
- implements RunScriptOnNode
- Author:
- Adrian Cole
logger
@Named(value="jclouds.compute")
protected Logger logger
sshFactory
protected final com.google.common.base.Function<NodeMetadata,SshClient> sshFactory
node
protected final NodeMetadata node
init
protected final Statement init
name
protected final String name
runAsRoot
protected final boolean runAsRoot
ssh
protected SshClient ssh
RunScriptOnNodeAsInitScriptUsingSsh
public RunScriptOnNodeAsInitScriptUsingSsh(com.google.common.base.Function<NodeMetadata,SshClient> sshFactory,
NodeMetadata node,
Statement script,
RunScriptOptions options)
createInitScript
public static InitBuilder createInitScript(String name,
Statement script)
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
doCall
protected ExecResponse doCall()
- ssh client is initialized through this call.
runAction
protected ExecResponse runAction(String action)
runCommand
protected ExecResponse runCommand(String command)
execScriptAsRoot
public String execScriptAsRoot(String action)
execScriptAsDefaultUser
protected String execScriptAsDefaultUser(String action)
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
Copyright © 2009-2011 jclouds. All Rights Reserved.