@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getApplicationArn() == null) ? 0 : getApplicationArn().hashCode()); hashCode = prime * hashCode + ((getApplicationName() == null) ? 0 : getApplicationName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getDateCreated() == null) ? 0 : getDateCreated().hashCode()); hashCode = prime * hashCode + ((getDateUpdated() == null) ? 0 : getDateUpdated().hashCode()); hashCode = prime * hashCode + ((getVersions() == null) ? 0 : getVersions().hashCode()); hashCode = prime * hashCode + ((getConfigurationTemplates() == null) ? 0 : getConfigurationTemplates().hashCode()); hashCode = prime * hashCode + ((getResourceLifecycleConfig() == null) ? 0 : getResourceLifecycleConfig().hashCode()); return hashCode; }
public ApplicationDescription unmarshall(StaxUnmarshallerContext context) throws Exception { ApplicationDescription applicationDescription = new ApplicationDescription(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; applicationDescription.setApplicationArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.setApplicationName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.setDateCreated(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; applicationDescription.setDateUpdated(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; applicationDescription.withVersions(new ArrayList<String>()); continue; applicationDescription.withVersions(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.withConfigurationTemplates(new ArrayList<String>()); continue; applicationDescription.withConfigurationTemplates(StringStaxUnmarshaller.getInstance().unmarshall(context));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateApplicationResult == false) return false; CreateApplicationResult other = (CreateApplicationResult) obj; if (other.getApplication() == null ^ this.getApplication() == null) return false; if (other.getApplication() != null && other.getApplication().equals(this.getApplication()) == false) return false; return true; }
@Override public String apply(ApplicationDescription input) { return input.getApplicationName(); } });
boolean appNameFound = false; for (ApplicationDescription appdesc : appResult.getApplications()) { if (appdesc.getApplicationName().equals(TEST_APPNAME)) { appNameFound = true; assertTrue(appdesc.getDescription().equals(TEST_APPDESC)); break;
@Override protected Object executeInternal() throws MojoExecutionException, MojoFailureException { DescribeApplicationsRequest req = new DescribeApplicationsRequest().withApplicationNames(applicationName); DescribeApplicationsResult apps = getService().describeApplications(req); List<ApplicationDescription> applications = apps.getApplications(); if (applications.isEmpty()) { String errorMessage = "Application ('" + applicationName + "') not found!"; getLog().warn(errorMessage); throw new MojoFailureException(errorMessage); } ApplicationDescription desc = applications.get(0); List<String> configTemplates = desc.getConfigurationTemplates(); getLog().info(format("There are %d config templates", configTemplates.size())); return configTemplates; } }
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)); } }
boolean appNameFound = false; for (ApplicationDescription appdesc : appResult.getApplications()) { if (appdesc.getApplicationName().equals(TEST_APPNAME)) { appNameFound = true; assertTrue(appdesc.getDescription().equals(TEST_APPDESC)); break;
@SuppressWarnings("unchecked") protected List<String> getConfigurationTemplates(String applicationName) { List<String> configurationTemplates = getService() .describeApplications(new DescribeApplicationsRequest().withApplicationNames(applicationName)) .getApplications() .get(0) .getConfigurationTemplates(); Collections.<String>sort(configurationTemplates, new ReverseComparator(String.CASE_INSENSITIVE_ORDER)); return configurationTemplates; }
return false; ApplicationDescription other = (ApplicationDescription) obj; if (other.getApplicationArn() == null ^ this.getApplicationArn() == null) return false; if (other.getApplicationArn() != null && other.getApplicationArn().equals(this.getApplicationArn()) == false) return false; if (other.getApplicationName() == null ^ this.getApplicationName() == null) return false; if (other.getApplicationName() != null && other.getApplicationName().equals(this.getApplicationName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getDateCreated() == null ^ this.getDateCreated() == null) return false; if (other.getDateCreated() != null && other.getDateCreated().equals(this.getDateCreated()) == false) return false; if (other.getDateUpdated() == null ^ this.getDateUpdated() == null) return false; if (other.getDateUpdated() != null && other.getDateUpdated().equals(this.getDateUpdated()) == false) return false; if (other.getVersions() == null ^ this.getVersions() == null) return false; if (other.getVersions() != null && other.getVersions().equals(this.getVersions()) == false) return false; if (other.getConfigurationTemplates() == null ^ this.getConfigurationTemplates() == null) return false; if (other.getConfigurationTemplates() != null && other.getConfigurationTemplates().equals(this.getConfigurationTemplates()) == false)
public ApplicationDescription unmarshall(StaxUnmarshallerContext context) throws Exception { ApplicationDescription applicationDescription = new ApplicationDescription(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; applicationDescription.setApplicationArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.setApplicationName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.setDateCreated(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; applicationDescription.setDateUpdated(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; applicationDescription.withVersions(new ArrayList<String>()); continue; applicationDescription.withVersions(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; applicationDescription.withConfigurationTemplates(new ArrayList<String>()); continue; applicationDescription.withConfigurationTemplates(StringStaxUnmarshaller.getInstance().unmarshall(context));
List<EbsVH> ebsList = new ArrayList<>(); for(ApplicationDescription appDes : appDesList) { List<EnvironmentDescription> envDesList = awsElasticBeanstalk.describeEnvironments(new DescribeEnvironmentsRequest().withApplicationName(appDes.getApplicationName())).getEnvironments(); if(envDesList.isEmpty()) { EbsVH ebsObj = new EbsVH();
@Override protected Object executeInternal() throws Exception { DescribeApplicationsRequest req = new DescribeApplicationsRequest().withApplicationNames(applicationName); boolean bConfigurationTemplateDefined = StringUtils.isNotBlank(configurationTemplate); DescribeApplicationsResult apps = getService().describeApplications(req); List<ApplicationDescription> applications = apps.getApplications(); if (applications.isEmpty()) { String errorMessage = "Application ('" + applicationName + "') not found!"; getLog().warn(errorMessage); throw new MojoFailureException(errorMessage); } ApplicationDescription desc = applications.get(0); List<String> configTemplates = desc.getConfigurationTemplates(); if (bConfigurationTemplateDefined) { describeConfigurationTemplate(configurationTemplate); } else { for (String availConfigTemplate : configTemplates) { describeConfigurationTemplate(availConfigTemplate); } } return null; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateApplicationResult == false) return false; UpdateApplicationResult other = (UpdateApplicationResult) obj; if (other.getApplication() == null ^ this.getApplication() == null) return false; if (other.getApplication() != null && other.getApplication().equals(this.getApplication()) == false) return false; return true; }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getApplicationArn() != null) sb.append("ApplicationArn: ").append(getApplicationArn()).append(","); if (getApplicationName() != null) sb.append("ApplicationName: ").append(getApplicationName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getDateCreated() != null) sb.append("DateCreated: ").append(getDateCreated()).append(","); if (getDateUpdated() != null) sb.append("DateUpdated: ").append(getDateUpdated()).append(","); if (getVersions() != null) sb.append("Versions: ").append(getVersions()).append(","); if (getConfigurationTemplates() != null) sb.append("ConfigurationTemplates: ").append(getConfigurationTemplates()).append(","); if (getResourceLifecycleConfig() != null) sb.append("ResourceLifecycleConfig: ").append(getResourceLifecycleConfig()); sb.append("}"); return sb.toString();
@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; } } } }
if (existingApps.get(0).getConfigurationTemplates().contains(templateName)) { if (deleteTemplateIfExists) { eb.deleteConfigurationTemplate(new DeleteConfigurationTemplateRequest()
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateApplicationResult == false) return false; CreateApplicationResult other = (CreateApplicationResult) obj; if (other.getApplication() == null ^ this.getApplication() == null) return false; if (other.getApplication() != null && other.getApplication().equals(this.getApplication()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getApplicationArn() == null) ? 0 : getApplicationArn().hashCode()); hashCode = prime * hashCode + ((getApplicationName() == null) ? 0 : getApplicationName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getDateCreated() == null) ? 0 : getDateCreated().hashCode()); hashCode = prime * hashCode + ((getDateUpdated() == null) ? 0 : getDateUpdated().hashCode()); hashCode = prime * hashCode + ((getVersions() == null) ? 0 : getVersions().hashCode()); hashCode = prime * hashCode + ((getConfigurationTemplates() == null) ? 0 : getConfigurationTemplates().hashCode()); hashCode = prime * hashCode + ((getResourceLifecycleConfig() == null) ? 0 : getResourceLifecycleConfig().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateApplicationResult == false) return false; UpdateApplicationResult other = (UpdateApplicationResult) obj; if (other.getApplication() == null ^ this.getApplication() == null) return false; if (other.getApplication() != null && other.getApplication().equals(this.getApplication()) == false) return false; return true; }