org.kuali.maven.ec2
Class LaunchMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.kuali.maven.ec2.AbstractEC2Mojo
          extended by org.kuali.maven.ec2.LaunchMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class LaunchMojo
extends AbstractEC2Mojo

Connect to EC2 and launch a a single instance configured according to user preferences. By default, the plugin waits until the instance reaches the state of "running" before allowing the build to continue. Once an EC2 instance is "running" Amazon has assigned it a public dns name. The public dns name, the instance id, and the value of the tag "Name" (if that tag is supplied) are stored as the project properties ec2.instance.dns, ec2.instance.id, ec2.instance.name, respectively. If wait is false, the ec2.instance.dns property will not be set since the instance will not have a public dns name by the time the plugin execution completes.


Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
LaunchMojo()
           
 
Method Summary
 void execute()
           
 String getAmi()
           
 String getEncoding()
           
protected  com.amazonaws.services.ec2.model.Instance getInstance(com.amazonaws.services.ec2.AmazonEC2 client, com.amazonaws.services.ec2.model.RunInstancesRequest request)
           
 String getKey()
           
 org.apache.maven.project.MavenProject getProject()
           
protected  com.amazonaws.services.ec2.model.RunInstancesRequest getRequest()
           
 List<String> getSecurityGroups()
           
 String getState()
           
protected  String getString(String location, String encoding)
           
 List<com.amazonaws.services.ec2.model.Tag> getTags()
           
 String getType()
           
 String getUserData()
           
protected  String getUserData(String data, String location, String encoding)
           
 String getUserDataFile()
           
 int getWaitTimeout()
           
protected  void handleTags(com.amazonaws.services.ec2.AmazonEC2 client, com.amazonaws.services.ec2.model.Instance instance, List<com.amazonaws.services.ec2.model.Tag> tags)
           
 boolean isFilterUserData()
           
 boolean isWait()
           
 void setAmi(String ami)
           
 void setEncoding(String encoding)
           
 void setFilterUserData(boolean filterUserData)
           
 void setKey(String key)
           
 void setSecurityGroups(List<String> securityGroups)
           
 void setState(String state)
           
 void setTags(List<com.amazonaws.services.ec2.model.Tag> tags)
           
 void setType(String type)
           
 void setUserData(String userData)
           
 void setUserDataFile(String userDataFile)
           
 void setWait(boolean wait)
           
 void setWaitTimeout(int waitTimeout)
           
protected  void wait(com.amazonaws.services.ec2.AmazonEC2 client, com.amazonaws.services.ec2.model.Instance i)
           
 
Methods inherited from class org.kuali.maven.ec2.AbstractEC2Mojo
getAccessKey, getCredentials, getEC2Client, getInstance, getInstances, getSecretKey, getTagValue, isEmpty, setAccessKey, setSecretKey, sleep, waitForState
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LaunchMojo

public LaunchMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getRequest

protected com.amazonaws.services.ec2.model.RunInstancesRequest getRequest()
                                                                   throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getInstance

protected com.amazonaws.services.ec2.model.Instance getInstance(com.amazonaws.services.ec2.AmazonEC2 client,
                                                                com.amazonaws.services.ec2.model.RunInstancesRequest request)

wait

protected void wait(com.amazonaws.services.ec2.AmazonEC2 client,
                    com.amazonaws.services.ec2.model.Instance i)
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

handleTags

protected void handleTags(com.amazonaws.services.ec2.AmazonEC2 client,
                          com.amazonaws.services.ec2.model.Instance instance,
                          List<com.amazonaws.services.ec2.model.Tag> tags)

getUserData

protected String getUserData(String data,
                             String location,
                             String encoding)
                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getString

protected String getString(String location,
                           String encoding)
                    throws IOException
Throws:
IOException

getAmi

public String getAmi()

setAmi

public void setAmi(String ami)

getKey

public String getKey()

setKey

public void setKey(String key)

getType

public String getType()

setType

public void setType(String type)

getSecurityGroups

public List<String> getSecurityGroups()

setSecurityGroups

public void setSecurityGroups(List<String> securityGroups)

getUserData

public String getUserData()

setUserData

public void setUserData(String userData)

getEncoding

public String getEncoding()

setEncoding

public void setEncoding(String encoding)

isFilterUserData

public boolean isFilterUserData()

setFilterUserData

public void setFilterUserData(boolean filterUserData)

getProject

public org.apache.maven.project.MavenProject getProject()

getTags

public List<com.amazonaws.services.ec2.model.Tag> getTags()

setTags

public void setTags(List<com.amazonaws.services.ec2.model.Tag> tags)

isWait

public boolean isWait()

setWait

public void setWait(boolean wait)

getWaitTimeout

public int getWaitTimeout()

setWaitTimeout

public void setWaitTimeout(int waitTimeout)

getState

public String getState()

setState

public void setState(String state)

getUserDataFile

public String getUserDataFile()

setUserDataFile

public void setUserDataFile(String userDataFile)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.