Package org.jclouds.compute.callables
Class RunScriptOnNodeUsingSsh
java.lang.Object
org.jclouds.compute.callables.RunScriptOnNodeUsingSsh
- All Implemented Interfaces:
Callable<ExecResponse>
,RunScriptOnNode
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jclouds.compute.callables.RunScriptOnNode
RunScriptOnNode.Factory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.google.common.eventbus.EventBus
protected Logger
static final String
protected final NodeMetadata
protected final boolean
protected SshClient
protected final com.google.common.base.Function
<NodeMetadata, SshClient> protected final Statement
-
Constructor Summary
ConstructorsConstructorDescriptionRunScriptOnNodeUsingSsh
(com.google.common.base.Function<NodeMetadata, SshClient> sshFactory, com.google.common.eventbus.EventBus eventBus, NodeMetadata node, Statement statement, RunScriptOptions options) -
Method Summary
Modifier and TypeMethodDescriptioncall()
Note thatRunScriptOnNode.init()
must be called first.execAsRoot
(String command) protected String
execScriptAsDefaultUser
(String command) getNode()
the node this command is being executed on.init()
verifies that the command can execute on the node.protected ExecResponse
runCommand
(String command) toString()
-
Field Details
-
MARKER
- See Also:
-
logger
-
sshFactory
-
eventBus
protected final com.google.common.eventbus.EventBus eventBus -
node
-
statement
-
runAsRoot
protected final boolean runAsRoot -
ssh
-
-
Constructor Details
-
RunScriptOnNodeUsingSsh
public RunScriptOnNodeUsingSsh(com.google.common.base.Function<NodeMetadata, SshClient> sshFactory, com.google.common.eventbus.EventBus eventBus, NodeMetadata node, Statement statement, RunScriptOptions options)
-
-
Method Details
-
call
Description copied from interface:RunScriptOnNode
Note thatRunScriptOnNode.init()
must be called first.- Specified by:
call
in interfaceCallable<ExecResponse>
- Specified by:
call
in interfaceRunScriptOnNode
-
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 interfaceRunScriptOnNode
-
runCommand
-
execAsRoot
-
execScriptAsDefaultUser
-
getNode
Description copied from interface:RunScriptOnNode
the node this command is being executed on.- Specified by:
getNode
in interfaceRunScriptOnNode
-
toString
-
getStatement
- Specified by:
getStatement
in interfaceRunScriptOnNode
- Returns:
- statement that will be executed
-