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.EventBusprotected Loggerstatic final Stringprotected final NodeMetadataprotected final booleanprotected SshClientprotected 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 StringexecScriptAsDefaultUser(String command) getNode()the node this command is being executed on.init()verifies that the command can execute on the node.protected ExecResponserunCommand(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:RunScriptOnNodeNote thatRunScriptOnNode.init()must be called first.- Specified by:
callin interfaceCallable<ExecResponse>- Specified by:
callin interfaceRunScriptOnNode
-
init
Description copied from interface:RunScriptOnNodeverifies 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:
initin interfaceRunScriptOnNode
-
runCommand
-
execAsRoot
-
execScriptAsDefaultUser
-
getNode
Description copied from interface:RunScriptOnNodethe node this command is being executed on.- Specified by:
getNodein interfaceRunScriptOnNode
-
toString
-
getStatement
- Specified by:
getStatementin interfaceRunScriptOnNode- Returns:
- statement that will be executed
-