/** * Constructs a new DeleteApplicationRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param applicationName * The name of the application to delete. */ public DeleteApplicationRequest(String applicationName) { setApplicationName(applicationName); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getApplicationName() == null) ? 0 : getApplicationName().hashCode()); hashCode = prime * hashCode + ((getTerminateEnvByForce() == null) ? 0 : getTerminateEnvByForce().hashCode()); return hashCode; }
/** * <p> * When set to true, running environments will be terminated before deleting the application. * </p> * * @param terminateEnvByForce * When set to true, running environments will be terminated before deleting the application. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationRequest withTerminateEnvByForce(Boolean terminateEnvByForce) { setTerminateEnvByForce(terminateEnvByForce); return this; }
public void terminateApplication(String name) { DeleteApplicationRequest dr = new DeleteApplicationRequest(name); beanstalkClient.deleteApplication(dr); }
@Override protected Object executeInternal() throws MojoExecutionException, MojoFailureException { DeleteApplicationRequest req = new DeleteApplicationRequest(); req.setApplicationName(applicationName); getService().deleteApplication(req); return null; } }
public void execute() throws Exception { for (ApplicationDescription appDesc : service.describeApplications().getApplications()) { if (!appDesc.getApplicationName().startsWith("mbit-")) { info("Ignoring application name %s", appDesc.getApplicationName()); continue; } else { info("Browsing environments for app name %s", appDesc.getApplicationName()); } info("Deleting application"); service.deleteApplication(new DeleteApplicationRequest().withApplicationName(appDesc.getApplicationName()).withTerminateEnvByForce(true)); } }
@TaskAction public void deleteApplication() { // to enable conventionMappings feature String appName = getAppName(); AwsBeanstalkPluginExtension ext = getProject().getExtensions().getByType(AwsBeanstalkPluginExtension.class); AWSElasticBeanstalk eb = ext.getClient(); eb.deleteApplication(new DeleteApplicationRequest(appName)); getLogger().info("application " + appName + " deleted"); } }
public void execute() { checkParams(); AWSElasticBeanstalkClient bcClient = getOrCreateClient(AWSElasticBeanstalkClient.class); bcClient.deleteApplication(new DeleteApplicationRequest(applicationName)); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteApplicationRequest == false) return false; DeleteApplicationRequest other = (DeleteApplicationRequest) obj; if (other.getApplicationName() == null ^ this.getApplicationName() == null) return false; if (other.getApplicationName() != null && other.getApplicationName().equals(this.getApplicationName()) == false) return false; if (other.getTerminateEnvByForce() == null ^ this.getTerminateEnvByForce() == null) return false; if (other.getTerminateEnvByForce() != null && other.getTerminateEnvByForce().equals(this.getTerminateEnvByForce()) == false) return false; return true; }
/** * <p> * The name of the application to delete. * </p> * * @param applicationName * The name of the application to delete. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationRequest withApplicationName(String applicationName) { setApplicationName(applicationName); return this; }
/** * <p> * When set to true, running environments will be terminated before deleting the application. * </p> * * @param terminateEnvByForce * When set to true, running environments will be terminated before deleting the application. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationRequest withTerminateEnvByForce(Boolean terminateEnvByForce) { setTerminateEnvByForce(terminateEnvByForce); return this; }
@After public void tearDown() throws InterruptedException { bcClient.terminateEnvironment(new TerminateEnvironmentRequest() .withEnvironmentName(TEST_ENVIRONMENTNAME)); AWSTestUtils.waitForEnvironmentToTransitionToStateAndHealth( TEST_ENVIRONMENTNAME, EnvironmentStatus.Terminated, null, bcClient); bcClient.deleteApplication(new DeleteApplicationRequest(TEST_APPNAME)); while (true) { DescribeApplicationsResult appResult = bcClient .describeApplications(); boolean appNameFound = false; for (ApplicationDescription appdesc : appResult.getApplications()) { if (appdesc.getApplicationName().equals(TEST_APPNAME)) { appNameFound = true; break; } } if (!appNameFound) { break; } } } }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getApplicationName() != null) sb.append("ApplicationName: ").append(getApplicationName()).append(","); if (getTerminateEnvByForce() != null) sb.append("TerminateEnvByForce: ").append(getTerminateEnvByForce()); sb.append("}"); return sb.toString(); }
/** * Constructs a new DeleteApplicationRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param applicationName * The name of the application to delete. */ public DeleteApplicationRequest(String applicationName) { setApplicationName(applicationName); }
public Request<DeleteApplicationRequest> marshall(DeleteApplicationRequest deleteApplicationRequest) { if (deleteApplicationRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DeleteApplicationRequest> request = new DefaultRequest<DeleteApplicationRequest>(deleteApplicationRequest, "AWSElasticBeanstalk"); request.addParameter("Action", "DeleteApplication"); request.addParameter("Version", "2010-12-01"); request.setHttpMethod(HttpMethodName.POST); if (deleteApplicationRequest.getApplicationName() != null) { request.addParameter("ApplicationName", StringUtils.fromString(deleteApplicationRequest.getApplicationName())); } if (deleteApplicationRequest.getTerminateEnvByForce() != null) { request.addParameter("TerminateEnvByForce", StringUtils.fromBoolean(deleteApplicationRequest.getTerminateEnvByForce())); } return request; }
/** * <p> * The name of the application to delete. * </p> * * @param applicationName * The name of the application to delete. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationRequest withApplicationName(String applicationName) { setApplicationName(applicationName); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getApplicationName() == null) ? 0 : getApplicationName().hashCode()); hashCode = prime * hashCode + ((getTerminateEnvByForce() == null) ? 0 : getTerminateEnvByForce().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteApplicationRequest == false) return false; DeleteApplicationRequest other = (DeleteApplicationRequest) obj; if (other.getApplicationName() == null ^ this.getApplicationName() == null) return false; if (other.getApplicationName() != null && other.getApplicationName().equals(this.getApplicationName()) == false) return false; if (other.getTerminateEnvByForce() == null ^ this.getTerminateEnvByForce() == null) return false; if (other.getTerminateEnvByForce() != null && other.getTerminateEnvByForce().equals(this.getTerminateEnvByForce()) == false) return false; return true; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getApplicationName() != null) sb.append("ApplicationName: ").append(getApplicationName()).append(","); if (getTerminateEnvByForce() != null) sb.append("TerminateEnvByForce: ").append(getTerminateEnvByForce()); sb.append("}"); return sb.toString(); }
public Request<DeleteApplicationRequest> marshall(DeleteApplicationRequest deleteApplicationRequest) { if (deleteApplicationRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DeleteApplicationRequest> request = new DefaultRequest<DeleteApplicationRequest>(deleteApplicationRequest, "AWSElasticBeanstalk"); request.addParameter("Action", "DeleteApplication"); request.addParameter("Version", "2010-12-01"); request.setHttpMethod(HttpMethodName.POST); if (deleteApplicationRequest.getApplicationName() != null) { request.addParameter("ApplicationName", StringUtils.fromString(deleteApplicationRequest.getApplicationName())); } if (deleteApplicationRequest.getTerminateEnvByForce() != null) { request.addParameter("TerminateEnvByForce", StringUtils.fromBoolean(deleteApplicationRequest.getTerminateEnvByForce())); } return request; }