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
blockOnComplete, overridingCredentials, port, runAsRoot, seconds, taskName, wrapInInitScript
 
Constructor Summary
TemplateOptions.ImmutableTemplateOptions(TemplateOptions delegate)
           
 
Method Summary
<T extends TemplateOptions>
T
as(Class<T> clazz)
           
 TemplateOptions authorizePublicKey(Payload publicKey)
          Deprecated. 
 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()
           
 Credentials getOverridingCredentials()
          Whether to override the credentials with ones supplied in call to org.jclouds.compute.ComputeService#runScriptOnNodesWithTag.
 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(Payload privateKey)
          replaces the rsa ssh key used at login.
 TemplateOptions installPrivateKey(String privateKey)
          replaces the rsa ssh key used at login.
 TemplateOptions nameTask(String name)
           
 TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
           
 TemplateOptions overrideLoginCredentialWith(String loginCredential)
           
 TemplateOptions overrideLoginUserWith(String loginUser)
           
 TemplateOptions runAsRoot(boolean runAsRoot)
           
 TemplateOptions runScript(byte[] script)
          

please use alternative that uses the Statement object

 TemplateOptions runScript(Payload script)
           
 TemplateOptions runScript(Statement script)
          unsupported as objects of this class are immutable
 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
 
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

getOverridingCredentials

public Credentials getOverridingCredentials()
Description copied from class: RunScriptOptions
Whether to override the credentials with ones supplied in call to org.jclouds.compute.ComputeService#runScriptOnNodesWithTag. By default, true.

Overrides:
getOverridingCredentials in class RunScriptOptions
Returns:
value

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

installPrivateKey

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

please use alternative that uses String

Overrides:
installPrivateKey in class TemplateOptions
See Also:
Payloads

dontAuthorizePublicKey

public TemplateOptions dontAuthorizePublicKey()
Overrides:
dontAuthorizePublicKey in class TemplateOptions

authorizePublicKey

@Deprecated
public TemplateOptions authorizePublicKey(Payload publicKey)
Deprecated. 

Description copied from class: TemplateOptions
authorize an rsa ssh key.

please use alternative that uses String

Overrides:
authorizePublicKey in class TemplateOptions
See Also:
Payloads

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

overrideCredentialsWith

public TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
Overrides:
overrideCredentialsWith in class TemplateOptions

overrideLoginUserWith

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

overrideLoginCredentialWith

public TemplateOptions overrideLoginCredentialWith(String loginCredential)
Overrides:
overrideLoginCredentialWith 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)

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

runScript

public TemplateOptions runScript(byte[] script)
Description copied from class: TemplateOptions

please use alternative that uses the Statement object

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

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-2011 jclouds. All Rights Reserved.