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()

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

@deprecated since 0.6; use LocationSpec (which calls no-arg constructor)

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

java.lang.String getJcloudsId()

NodeMetadata getNode()

OsDetails getOsDetails()

JcloudsLocation getParent()

protected Optional getPrivateAddress()

java.lang.String getSubnetHostname()

returns the hostname (or sometimes IP) for use by peers in the same subnet, defaulting to public hostname if nothing special

java.lang.String getSubnetIp()

void init()

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)

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

java.util.Map toMetadataRecord()

java.lang.String toVerboseString()

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, finalize, findKeyPair, findPassword, getAddress, getOsDetails, getPort, getSshHostAndPort, getUser, hasMutex, installTo, isSshable, newExecWithLoggingHelpers, newMutexSupport, obtainPort, obtainSpecificPort, releaseMutex, releasePort, run, run, run, run, run, run, run, run, toString, toVerboseString, tryAcquireMutex
 
Methods inherited from class AbstractLocation
addChild, addChild, addChildLocation, addExtension, assertNotYetManaged, configure, containsLocation, equals, findLocationProperty, getAllConfig, getAllConfig, getChildLocations, getChildren, getConfig, getConfigBag, getDisplayName, getExtension, getHostGeoInfo, getId, getLocationProperty, getManagementContext, getName, getParent, getParentLocation, getRawLocalConfigBag, getRebindSupport, hasConfig, hasConfig, hasExtension, hasLocationProperty, hashCode, init, isLegacyConstruction, isManaged, onManagementStarted, onManagementStopped, removeChild, removeChildLocation, setConfig, setHostGeoInfo, setManagementContext, setName, setParent, setParentLocation, string, toMetadataRecord, toString, toVerboseString
 

Constructor Detail

JcloudsSshMachineLocation

public JcloudsSshMachineLocation()


JcloudsSshMachineLocation

@Deprecated
public JcloudsSshMachineLocation(java.util.Map flags, JcloudsLocation jcloudsParent, NodeMetadata node)
deprecated:
since 0.6; use LocationSpec (which calls no-arg constructor)


 
Method Detail

execRemoteScript

public void execRemoteScript(java.lang.String... commands)


getJcloudsId

public java.lang.String getJcloudsId()


getNode

public NodeMetadata getNode()


getOsDetails

? node.getOperatingSystem().getName() : "linux",
public OsDetails getOsDetails()


getParent

public JcloudsLocation getParent()


getPrivateAddress

protected Optional getPrivateAddress()


getSubnetHostname

@Override
public java.lang.String getSubnetHostname()
returns the hostname (or sometimes IP) 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


getSubnetIp

Optional privateAddress = getPrivateAddress();
public java.lang.String getSubnetIp()


init

@Override
public void init()


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)
uses submitRunScript to execute the commands, and throws error if it fails or returns non-zero


toMetadataRecord

ImmutableMap.Builder builder = ImmutableMap.builder();
public java.util.Map toMetadataRecord()


toVerboseString

@Override
public java.lang.String toVerboseString()


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.