Brooklyn

brooklyn.location.jclouds
[Java] Class JcloudsSshMachineLocation

java.lang.Object
  brooklyn.location.basic.AbstractLocation
      brooklyn.location.basic.SshMachineLocation
          brooklyn.location.jclouds.JcloudsSshMachineLocation
All Implemented Interfaces:
HasSubnetHostname

public class JcloudsSshMachineLocation
extends SshMachineLocation

Field Summary
 
Fields inherited from class SshMachineLocation
ALLOCATE_PTY, ALL_SSH_CONFIG_KEYS, ALL_SSH_CONFIG_KEY_NAMES, LOCAL_TEMP_DIR, LOG, LOG_PREFIX, NO_STDERR_LOGGING, NO_STDOUT_LOGGING, PASSWORD, PRIVATE_KEY_DATA, PRIVATE_KEY_FILE, PRIVATE_KEY_PASSPHRASE, REUSABLE_SSH_PROPS, SCP_EXECUTABLE, SCRIPT_DIR, SSHCONFIG_PREFIX, SSH_ENV_MAP, SSH_EXECUTABLE, SSH_HOST, SSH_PORT, STDERR, STDOUT, logSsh, previouslyConnected
 
Fields inherited from class AbstractLocation
LOG, PARENT_LOCATION, hostGeoInfo, name
 
Constructor Summary
JcloudsSshMachineLocation(java.util.Map flags, JcloudsLocation parent, NodeMetadata node)

 
Method Summary
void execRemoteScript(java.lang.String... commands)

uses submitRunScript to execute the commands, and throws error if it fails or returns non-zero

java.lang.String getJcloudsId()

NodeMetadata getNode()

OsDetails getOsDetails()

JcloudsLocation getParent()

java.lang.String getSubnetHostname()

returns the hostname for use by peers in the same subnet, defaulting to public hostname if nothing special

ListenableFuture submitRunScript(java.lang.String... statements)

executes the given statements on the server using jclouds ScriptBuilder, wrapping in a script which is polled periodically.

ListenableFuture submitRunScript(Statement script)

ListenableFuture submitRunScript(Statement script, RunScriptOptions options)

java.lang.String waitForPassword()

Retrieves the password for this VM, if one exists.

 
Methods inherited from class SshMachineLocation
acquireMutex, addConfig, close, configure, connectSsh, connectSsh, copyFrom, copyFrom, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, exec, exec, exec, exec, execCommands, execCommands, execCommands, execCommands, execScript, execScript, execScript, execScript, execSsh, execWithLogging, execWithLogging, finalize, getAddress, getOsDetails, getUser, hasMutex, installTo, isSshable, newMutexSupport, obtainPort, obtainSpecificPort, releaseMutex, releasePort, run, run, run, run, run, run, run, run, toString, tryAcquireMutex
 
Methods inherited from class AbstractLocation
addChildLocation, configure, configure, containsLocation, equals, findLocationProperty, getAllConfig, getChildLocations, getConfig, getConfigBag, getHostGeoInfo, getId, getLocationProperty, getName, getParentLocation, getRebindSupport, hasConfig, hasLocationProperty, hashCode, removeChildLocation, setConfig, setHostGeoInfo, setName, setParentLocation, string, toString
 

Constructor Detail

JcloudsSshMachineLocation

public JcloudsSshMachineLocation(java.util.Map flags, JcloudsLocation parent, NodeMetadata node)


 
Method Detail

execRemoteScript

public void execRemoteScript(java.lang.String... commands)
uses submitRunScript to execute the commands, and throws error if it fails or returns non-zero


getJcloudsId

public java.lang.String getJcloudsId()


getNode

public NodeMetadata getNode()


getOsDetails

@Override
public OsDetails getOsDetails()


getParent

public JcloudsLocation getParent()


getSubnetHostname

public java.lang.String getSubnetHostname()
returns the hostname for use by peers in the same subnet, defaulting to public hostname if nothing special

for use e.g. in clouds like amazon where other machines in the same subnet need to use a different IP


submitRunScript

public ListenableFuture submitRunScript(java.lang.String... statements)
executes the given statements on the server using jclouds ScriptBuilder, wrapping in a script which is polled periodically. the output is returned once the script completes (disadvantage compared to other methods) but the process is nohupped and the SSH session is not kept, so very useful for long-running processes


submitRunScript

public ListenableFuture submitRunScript(Statement script)


submitRunScript

public ListenableFuture submitRunScript(Statement script, RunScriptOptions options)


waitForPassword

public java.lang.String waitForPassword()
Retrieves the password for this VM, if one exists. The behaviour/implementation is different for different clouds. e.g. on Rackspace, the password for a windows VM is available immediately; on AWS-EC2, for a Windows VM you need to poll repeatedly until the password is available which can take up to 15 minutes.


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.