org.jclouds.compute.options
Class TemplateOptions.ImmutableTemplateOptions

java.lang.Object
  extended by org.jclouds.compute.options.RunScriptOptions
      extended by org.jclouds.compute.options.TemplateOptions
          extended by org.jclouds.compute.options.TemplateOptions.ImmutableTemplateOptions
All Implemented Interfaces:
Cloneable
Enclosing class:
TemplateOptions

public static class TemplateOptions.ImmutableTemplateOptions
extends TemplateOptions


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jclouds.compute.options.TemplateOptions
TemplateOptions.Builder, TemplateOptions.ImmutableTemplateOptions
 
Nested classes/interfaces inherited from class org.jclouds.compute.options.RunScriptOptions
RunScriptOptions.ImmutableRunScriptOptions
 
Field Summary
 
Fields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, NONE, privateKey, publicKey, script, tags, userMetadata
 
Fields inherited from class org.jclouds.compute.options.RunScriptOptions
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
 
Constructor Summary
TemplateOptions.ImmutableTemplateOptions(TemplateOptions delegate)
           
 
Method Summary
<T extends TemplateOptions>
T
as(Class<T> clazz)
           
 TemplateOptions authorizePublicKey(String publicKey)
          authorize an rsa ssh key.
 TemplateOptions blockOnComplete(boolean blockOnComplete)
          As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.
 TemplateOptions blockOnPort(int port, int seconds)
          When the node is started, wait until the following port is active
 TemplateOptions blockUntilRunning(boolean blockUntilRunning)
          unsupported as objects of this class are immutable
 TemplateOptions clone()
           
 void copyTo(TemplateOptions to)
           
 TemplateOptions dontAuthorizePublicKey()
           
 int[] getInboundPorts()
           
 String getLoginPassword()
           
 String getLoginPrivateKey()
           
 String getLoginUser()
           
 int getPort()
           
 String getPrivateKey()
           
 String getPublicKey()
           
 Statement getRunScript()
           
 int getSeconds()
           
 Set<String> getTags()
           
 String getTaskName()
           
 Map<String,String> getUserMetadata()
           
 TemplateOptions inboundPorts(int... ports)
          Opens the set of ports to public access.
 TemplateOptions installPrivateKey(String privateKey)
          replaces the rsa ssh key used at login.
 TemplateOptions nameTask(String name)
           
 TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
           
 TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
          Deprecated. 
 TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
           
 TemplateOptions overrideLoginCredentialWith(String loginCredential)
          to be removed in jclouds 1.4.0
 TemplateOptions overrideLoginPassword(String password)
           
 TemplateOptions overrideLoginPrivateKey(String privateKey)
           
 TemplateOptions overrideLoginUser(String loginUser)
           
 TemplateOptions overrideLoginUserWith(String loginUser)
          Deprecated. 
 TemplateOptions runAsRoot(boolean runAsRoot)
           
 TemplateOptions runScript(Payload script)
          to be removed in jclouds 1.4.0
 TemplateOptions runScript(Statement script)
          unsupported as objects of this class are immutable
 Boolean shouldAuthenticateSudo()
           
 boolean shouldBlockOnComplete()
           
 boolean shouldBlockUntilRunning()
           
 boolean shouldRunAsRoot()
          Whether to run the script as root (or run with current privileges).
 boolean shouldWrapInInitScript()
          Whether to wait until the script has completed.
 TemplateOptions tags(Iterable<String> tags)
          assigns tags to the created nodes
 String toString()
           
 TemplateOptions userMetadata(Map<String,String> userMetadata)
           
 TemplateOptions userMetadata(String key, String value)
           
 TemplateOptions wrapInInitScript(boolean wrapInInitScript)
          default true

 
Methods inherited from class org.jclouds.compute.options.TemplateOptions
equals, hashCode, runScript
 
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
getOverridingCredentials, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemplateOptions.ImmutableTemplateOptions

public TemplateOptions.ImmutableTemplateOptions(TemplateOptions delegate)
Method Detail

clone

public TemplateOptions clone()
Overrides:
clone in class TemplateOptions

getTaskName

public String getTaskName()
Overrides:
getTaskName in class RunScriptOptions

getPort

public int getPort()
Overrides:
getPort in class RunScriptOptions

getSeconds

public int getSeconds()
Overrides:
getSeconds in class RunScriptOptions

shouldRunAsRoot

public boolean shouldRunAsRoot()
Description copied from class: RunScriptOptions
Whether to run the script as root (or run with current privileges). By default, true.

Overrides:
shouldRunAsRoot in class RunScriptOptions
Returns:
value

shouldBlockOnComplete

public boolean shouldBlockOnComplete()
Overrides:
shouldBlockOnComplete in class RunScriptOptions
See Also:
RunScriptOptions.blockOnComplete(boolean)

shouldWrapInInitScript

public boolean shouldWrapInInitScript()
Description copied from class: RunScriptOptions
Whether to wait until the script has completed. By default, true.

Overrides:
shouldWrapInInitScript in class RunScriptOptions
Returns:
value

copyTo

public void copyTo(TemplateOptions to)
Overrides:
copyTo in class TemplateOptions

toString

public String toString()
Overrides:
toString in class TemplateOptions

runScript

public TemplateOptions runScript(Payload script)
Description copied from class: TemplateOptions
to be removed in jclouds 1.4.0

Overrides:
runScript in class TemplateOptions
See Also:
runScript(Statement), Payloads

runScript

public TemplateOptions runScript(Statement script)
unsupported as objects of this class are immutable

Overrides:
runScript in class TemplateOptions

dontAuthorizePublicKey

public TemplateOptions dontAuthorizePublicKey()
Overrides:
dontAuthorizePublicKey in class TemplateOptions

blockOnPort

public TemplateOptions blockOnPort(int port,
                                   int seconds)
Description copied from class: RunScriptOptions
When the node is started, wait until the following port is active

Overrides:
blockOnPort in class TemplateOptions

nameTask

public TemplateOptions nameTask(String name)
Overrides:
nameTask in class TemplateOptions
Returns:
What to call the task relating to this script; default jclouds-script-timestamp where timestamp is millis since epoch

runAsRoot

public TemplateOptions runAsRoot(boolean runAsRoot)
Overrides:
runAsRoot in class TemplateOptions

wrapInInitScript

public TemplateOptions wrapInInitScript(boolean wrapInInitScript)
Description copied from class: RunScriptOptions
default true

Overrides:
wrapInInitScript in class TemplateOptions
Parameters:
wrapInInitScript - if the command is long-running, use this option to ensure it is wrapInInitScripted properly. (ex. have jclouds wrap it an init script, nohup, etc)
Returns:

blockOnComplete

public TemplateOptions blockOnComplete(boolean blockOnComplete)
Description copied from class: RunScriptOptions
As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.

Overrides:
blockOnComplete in class TemplateOptions
Parameters:
blockOnComplete - (default true) false means kick off the script in the background, but don't wait for it to finish. (as of version 1.1.0, implemented as nohup)

overrideLoginCredentials

public TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
Overrides:
overrideLoginCredentials in class TemplateOptions

overrideLoginPassword

public TemplateOptions overrideLoginPassword(String password)
Overrides:
overrideLoginPassword in class TemplateOptions

overrideLoginPrivateKey

public TemplateOptions overrideLoginPrivateKey(String privateKey)
Overrides:
overrideLoginPrivateKey in class TemplateOptions

overrideAuthenticateSudo

public TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
Overrides:
overrideAuthenticateSudo in class TemplateOptions

getLoginUser

public String getLoginUser()
Overrides:
getLoginUser in class RunScriptOptions
Returns:
the login user for ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions). By default, null.

shouldAuthenticateSudo

public Boolean shouldAuthenticateSudo()
Overrides:
shouldAuthenticateSudo in class RunScriptOptions
Returns:
Whether the login user should authenticate sudo during ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions). By default, null.

getLoginPassword

public String getLoginPassword()
Overrides:
getLoginPassword in class RunScriptOptions
Returns:
the login password for ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions). By default, null.

getLoginPrivateKey

public String getLoginPrivateKey()
Overrides:
getLoginPrivateKey in class RunScriptOptions
Returns:
the login ssh key for ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions). By default, null.

overrideCredentialsWith

@Deprecated
public TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
Deprecated. 

Description copied from class: RunScriptOptions
to be removed in jclouds 1.4.0

Overrides:
overrideCredentialsWith in class TemplateOptions
See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)

overrideLoginUserWith

@Deprecated
public TemplateOptions overrideLoginUserWith(String loginUser)
Deprecated. 

Description copied from class: RunScriptOptions
to be removed in jclouds 1.4.0

Overrides:
overrideLoginUserWith in class TemplateOptions
See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)

overrideLoginUser

public TemplateOptions overrideLoginUser(String loginUser)
Overrides:
overrideLoginUser in class TemplateOptions

overrideLoginCredentialWith

public TemplateOptions overrideLoginCredentialWith(String loginCredential)
Description copied from class: RunScriptOptions
to be removed in jclouds 1.4.0

Overrides:
overrideLoginCredentialWith in class TemplateOptions
See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)

as

public <T extends TemplateOptions> T as(Class<T> clazz)
Overrides:
as in class TemplateOptions

authorizePublicKey

public TemplateOptions authorizePublicKey(String publicKey)
Description copied from class: TemplateOptions
authorize an rsa ssh key.

Overrides:
authorizePublicKey in class TemplateOptions

blockUntilRunning

public TemplateOptions blockUntilRunning(boolean blockUntilRunning)
unsupported as objects of this class are immutable

Overrides:
blockUntilRunning in class TemplateOptions
Parameters:
blockUntilRunning - (default true) whether to block until the nodes in this template are in NodeState.RUNNING state

getInboundPorts

public int[] getInboundPorts()
Overrides:
getInboundPorts in class TemplateOptions

getPrivateKey

public String getPrivateKey()
Overrides:
getPrivateKey in class TemplateOptions

getPublicKey

public String getPublicKey()
Overrides:
getPublicKey in class TemplateOptions

getRunScript

public Statement getRunScript()
Overrides:
getRunScript in class TemplateOptions

shouldBlockUntilRunning

public boolean shouldBlockUntilRunning()
Overrides:
shouldBlockUntilRunning in class TemplateOptions
See Also:
blockUntilRunning(boolean)

inboundPorts

public TemplateOptions inboundPorts(int... ports)
Description copied from class: TemplateOptions
Opens the set of ports to public access.

Overrides:
inboundPorts in class TemplateOptions

installPrivateKey

public TemplateOptions installPrivateKey(String privateKey)
Description copied from class: TemplateOptions
replaces the rsa ssh key used at login.

Overrides:
installPrivateKey in class TemplateOptions

getTags

public Set<String> getTags()
Overrides:
getTags in class TemplateOptions

tags

public TemplateOptions tags(Iterable<String> tags)
Description copied from class: TemplateOptions
assigns tags to the created nodes

Overrides:
tags in class TemplateOptions

userMetadata

public TemplateOptions userMetadata(Map<String,String> userMetadata)
Overrides:
userMetadata in class TemplateOptions
Parameters:
userMetadata - user-defined metadata to assign to this server

userMetadata

public TemplateOptions userMetadata(String key,
                                    String value)
Overrides:
userMetadata in class TemplateOptions
Parameters:
key - key to place into the metadata map
value - value to associate with that key

getUserMetadata

public Map<String,String> getUserMetadata()
Overrides:
getUserMetadata in class TemplateOptions
See Also:
TemplateOptions.userMetadata(Map)


Copyright © 2009-2012 jclouds. All Rights Reserved.