org.jclouds.compute.callables
Class RunScriptOnNodeAsInitScriptUsingSsh

java.lang.Object
  extended by org.jclouds.compute.callables.SudoAwareInitManager
      extended by org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSsh
All Implemented Interfaces:
Callable<ExecResponse>, RunScriptOnNode
Direct Known Subclasses:
RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete

public class RunScriptOnNodeAsInitScriptUsingSsh
extends SudoAwareInitManager
implements RunScriptOnNode

Author:
Adrian Cole

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jclouds.compute.callables.RunScriptOnNode
RunScriptOnNode.Factory
 
Field Summary
protected  String initFile
           
protected  Logger logger
           
static String PROPERTY_INIT_SCRIPT_PATTERN
           
 
Fields inherited from class org.jclouds.compute.callables.SudoAwareInitManager
computeLogger, init, node, runAsRoot, ssh, sshFactory
 
Constructor Summary
RunScriptOnNodeAsInitScriptUsingSsh(com.google.common.base.Function<NodeMetadata,SshClient> sshFactory, NodeMetadata node, Statement script, RunScriptOptions options)
           
 
Method Summary
 ExecResponse call()
          Note that RunScriptOnNode.init() must be called first.
static InitBuilder createInitScript(String name, Statement script)
           
protected  ExecResponse doCall()
           
 RunScriptOnNodeAsInitScriptUsingSsh init()
          verifies that the command can execute on the node.
protected  void refreshSshIfNewAdminCredentialsConfigured(AdminAccess input)
           
protected  void setupLinkToInitFile()
           
 
Methods inherited from class org.jclouds.compute.callables.SudoAwareInitManager
execScriptAsDefaultUser, getNode, getStatement, refreshAndRunAction, runAction, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jclouds.compute.callables.RunScriptOnNode
getNode, getStatement
 

Field Detail

PROPERTY_INIT_SCRIPT_PATTERN

public static final String PROPERTY_INIT_SCRIPT_PATTERN
See Also:
Constant Field Values

logger

@Named(value="jclouds.compute")
protected Logger logger

initFile

protected final String initFile
Constructor Detail

RunScriptOnNodeAsInitScriptUsingSsh

public RunScriptOnNodeAsInitScriptUsingSsh(com.google.common.base.Function<NodeMetadata,SshClient> sshFactory,
                                           NodeMetadata node,
                                           Statement script,
                                           RunScriptOptions options)
Method Detail

init

public RunScriptOnNodeAsInitScriptUsingSsh 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
Overrides:
init in class SudoAwareInitManager

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

createInitScript

public static InitBuilder createInitScript(String name,
                                           Statement script)

refreshSshIfNewAdminCredentialsConfigured

protected void refreshSshIfNewAdminCredentialsConfigured(AdminAccess input)

doCall

protected ExecResponse doCall()

setupLinkToInitFile

protected void setupLinkToInitFile()


Copyright © 2009-2011 jclouds. All Rights Reserved.