List of usage examples for com.amazonaws.services.elasticbeanstalk.model DeleteApplicationRequest DeleteApplicationRequest
public DeleteApplicationRequest()
From source file:br.com.ingenieux.mojo.beanstalk.app.DeleteApplicationMojo.java
License:Apache License
@Override protected Object executeInternal() throws MojoExecutionException, MojoFailureException { DeleteApplicationRequest req = new DeleteApplicationRequest(); req.setApplicationName(applicationName); getService().deleteApplication(req); return null;/* w w w . j a va 2 s .c o m*/ }
From source file:fr.xebia.cloud.amazon.aws.tools.AmazonAwsUtils.java
License:Apache License
/** * Delete given application and wait for its removal. * * @param applicationName/*from www. java 2 s.c o m*/ * @param beanstalk */ public static void deleteBeanstalkApplicationIfExists(@Nonnull String applicationName, @Nonnull AWSElasticBeanstalk beanstalk) { ApplicationDescription application = Iterables.getFirst(beanstalk .describeApplications(new DescribeApplicationsRequest().withApplicationNames(applicationName)) .getApplications(), null); if (application == null) { logger.debug("No application named '{}' found", applicationName); return; } synchronousTerminateEnvironments(applicationName, beanstalk); beanstalk.deleteApplication(new DeleteApplicationRequest().withApplicationName(applicationName)); logger.info("Existing application {} deleted", applicationName); int counter = 0; while (application != null && counter < 1 * 60) { logger.debug("Wait for deletion of application {}", application); try { Thread.sleep(1000); } catch (InterruptedException e) { throw Throwables.propagate(e); } application = Iterables.getFirst(beanstalk .describeApplications(new DescribeApplicationsRequest().withApplicationNames(applicationName)) .getApplications(), null); } if (application == null) { logger.info("Application {} successfully deleted", applicationName); } else { logger.warn("Failure to delete application {}", applicationName); } }