@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEnvironmentName() == null) ? 0 : getEnvironmentName().hashCode()); hashCode = prime * hashCode + ((getEnvironmentId() == null) ? 0 : getEnvironmentId().hashCode()); hashCode = prime * hashCode + ((getApplicationName() == null) ? 0 : getApplicationName().hashCode()); hashCode = prime * hashCode + ((getVersionLabel() == null) ? 0 : getVersionLabel().hashCode()); hashCode = prime * hashCode + ((getSolutionStackName() == null) ? 0 : getSolutionStackName().hashCode()); hashCode = prime * hashCode + ((getPlatformArn() == null) ? 0 : getPlatformArn().hashCode()); hashCode = prime * hashCode + ((getTemplateName() == null) ? 0 : getTemplateName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getEndpointURL() == null) ? 0 : getEndpointURL().hashCode()); hashCode = prime * hashCode + ((getCNAME() == null) ? 0 : getCNAME().hashCode()); hashCode = prime * hashCode + ((getDateCreated() == null) ? 0 : getDateCreated().hashCode()); hashCode = prime * hashCode + ((getDateUpdated() == null) ? 0 : getDateUpdated().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getAbortableOperationInProgress() == null) ? 0 : getAbortableOperationInProgress().hashCode()); hashCode = prime * hashCode + ((getHealth() == null) ? 0 : getHealth().hashCode()); hashCode = prime * hashCode + ((getHealthStatus() == null) ? 0 : getHealthStatus().hashCode()); hashCode = prime * hashCode + ((getResources() == null) ? 0 : getResources().hashCode()); hashCode = prime * hashCode + ((getTier() == null) ? 0 : getTier().hashCode()); hashCode = prime * hashCode + ((getEnvironmentLinks() == null) ? 0 : getEnvironmentLinks().hashCode()); hashCode = prime * hashCode + ((getEnvironmentArn() == null) ? 0 : getEnvironmentArn().hashCode()); return hashCode; }
public CreateEnvironmentResult unmarshall(StaxUnmarshallerContext context) throws Exception { CreateEnvironmentResult createEnvironmentResult = new CreateEnvironmentResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; createEnvironmentResult.setEnvironmentName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setEnvironmentId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setApplicationName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setVersionLabel(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setSolutionStackName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setPlatformArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setTemplateName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setEndpointURL(StringStaxUnmarshaller.getInstance().unmarshall(context));
private String createEnvironment(String versionLabel, String versionDescription, String templateName, List<String> environmentNames) throws InvalidDeploymentTypeException { log("Creating environment based on application %s @ %s from version %s and configuration template %s", c.config.getApplicationName(), StringUtils.join(environmentNames, "/"), versionLabel, templateName); String newEnvironmentName = environmentNames.get(0); for (String environmentName : environmentNames) { try { lookupEnvironmentIds(Collections.singletonList(environmentName)); } catch (InvalidEnvironmentsSizeException e) { newEnvironmentName = environmentName; break; } } CreateEnvironmentRequest request = new CreateEnvironmentRequest() .withEnvironmentName(newEnvironmentName).withVersionLabel(versionLabel) .withDescription(versionDescription).withApplicationName(c.config.getApplicationName()) .withTemplateName(templateName); return getAwseb().createEnvironment(request).getEnvironmentId(); }
WaitForEnvironmentContext ctx = new WaitForEnvironmentContextBuilder() // .withEnvironmentRef(result.getEnvironmentId()) // .withApplicationName(result.getApplicationName()) // .withHealth(mustBeHealthy ? "Green" : null) // .withStatusToWaitFor("Ready") //
public String createEnvironmentWithWar(String applicationName, String domainName, String envName, String stackName, int minRam, String warFile, String versionLabel) { String endPoint=""; prepareWar(new File(warFile), versionLabel, applicationName); CreateEnvironmentRequest cr = new CreateEnvironmentRequest(); cr.setApplicationName(applicationName); cr.setEnvironmentName(envName); cr.setVersionLabel(versionLabel); String stack = findSolutionStack(stackName); if (!stack.equals("")) { cr.setSolutionStackName(stack); CheckDNSAvailabilityResult r = checkDNS(domainName); if (r.isAvailable()) { cr.setCNAMEPrefix(domainName); CreateEnvironmentResult res = beanstalkClient.createEnvironment(cr); endPoint=res.getEndpointURL(); journal.log(Level.INFO, ">> Status of the environment creation: " + res.toString()); } else { journal.log(Level.INFO, ">> Status of the environment creation: Domain Name already existing"); } } else { journal.log(Level.INFO, ">> Status of the environment creation: This type of stack does not exist!"); } return endPoint; }
try { CreateEnvironmentResult result = client.createEnvironment(eRequest); if ((cNAME = result.getCNAME()) == null) { System.out .println("Create environment request submitted. The environment configuration does not support a CNAME.");
newEnvDesc = waitForEnvironment(createEnvResult.getEnvironmentId()); } catch (Exception exc) { terminateEnvironment(createEnvResult.getEnvironmentId()); newEnvDesc = waitForGreenEnvironment(createEnvResult.getEnvironmentId());
return false; CreateEnvironmentResult other = (CreateEnvironmentResult) obj; if (other.getEnvironmentName() == null ^ this.getEnvironmentName() == null) return false; if (other.getEnvironmentName() != null && other.getEnvironmentName().equals(this.getEnvironmentName()) == false) return false; if (other.getEnvironmentId() == null ^ this.getEnvironmentId() == null) return false; if (other.getEnvironmentId() != null && other.getEnvironmentId().equals(this.getEnvironmentId()) == 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.getVersionLabel() == null ^ this.getVersionLabel() == null) return false; if (other.getVersionLabel() != null && other.getVersionLabel().equals(this.getVersionLabel()) == false) return false; if (other.getSolutionStackName() == null ^ this.getSolutionStackName() == null) return false; if (other.getSolutionStackName() != null && other.getSolutionStackName().equals(this.getSolutionStackName()) == false) return false; if (other.getPlatformArn() == null ^ this.getPlatformArn() == null) return false; if (other.getPlatformArn() != null && other.getPlatformArn().equals(this.getPlatformArn()) == false) return false; if (other.getTemplateName() == null ^ this.getTemplateName() == null) return false; if (other.getTemplateName() != null && other.getTemplateName().equals(this.getTemplateName()) == false)
public CreateEnvironmentResult unmarshall(StaxUnmarshallerContext context) throws Exception { CreateEnvironmentResult createEnvironmentResult = new CreateEnvironmentResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; createEnvironmentResult.setEnvironmentName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setEnvironmentId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setApplicationName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setVersionLabel(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setSolutionStackName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setPlatformArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setTemplateName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; createEnvironmentResult.setEndpointURL(StringStaxUnmarshaller.getInstance().unmarshall(context));
getLogger().info("environment {} @ {} ({}) created", envName, appName, result.getEnvironmentId()); } else { String environmentId = der.getEnvironments().get(0).getEnvironmentId();
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEnvironmentName() != null) sb.append("EnvironmentName: ").append(getEnvironmentName()).append(","); if (getEnvironmentId() != null) sb.append("EnvironmentId: ").append(getEnvironmentId()).append(","); if (getApplicationName() != null) sb.append("ApplicationName: ").append(getApplicationName()).append(","); if (getVersionLabel() != null) sb.append("VersionLabel: ").append(getVersionLabel()).append(","); if (getSolutionStackName() != null) sb.append("SolutionStackName: ").append(getSolutionStackName()).append(","); if (getPlatformArn() != null) sb.append("PlatformArn: ").append(getPlatformArn()).append(","); if (getTemplateName() != null) sb.append("TemplateName: ").append(getTemplateName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getEndpointURL() != null) sb.append("EndpointURL: ").append(getEndpointURL()).append(","); if (getCNAME() != null) sb.append("CNAME: ").append(getCNAME()).append(","); if (getDateCreated() != null) sb.append("DateCreated: ").append(getDateCreated()).append(","); if (getDateUpdated() != null) sb.append("DateUpdated: ").append(getDateUpdated()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getAbortableOperationInProgress() != null)
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEnvironmentName() == null) ? 0 : getEnvironmentName().hashCode()); hashCode = prime * hashCode + ((getEnvironmentId() == null) ? 0 : getEnvironmentId().hashCode()); hashCode = prime * hashCode + ((getApplicationName() == null) ? 0 : getApplicationName().hashCode()); hashCode = prime * hashCode + ((getVersionLabel() == null) ? 0 : getVersionLabel().hashCode()); hashCode = prime * hashCode + ((getSolutionStackName() == null) ? 0 : getSolutionStackName().hashCode()); hashCode = prime * hashCode + ((getPlatformArn() == null) ? 0 : getPlatformArn().hashCode()); hashCode = prime * hashCode + ((getTemplateName() == null) ? 0 : getTemplateName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getEndpointURL() == null) ? 0 : getEndpointURL().hashCode()); hashCode = prime * hashCode + ((getCNAME() == null) ? 0 : getCNAME().hashCode()); hashCode = prime * hashCode + ((getDateCreated() == null) ? 0 : getDateCreated().hashCode()); hashCode = prime * hashCode + ((getDateUpdated() == null) ? 0 : getDateUpdated().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getAbortableOperationInProgress() == null) ? 0 : getAbortableOperationInProgress().hashCode()); hashCode = prime * hashCode + ((getHealth() == null) ? 0 : getHealth().hashCode()); hashCode = prime * hashCode + ((getHealthStatus() == null) ? 0 : getHealthStatus().hashCode()); hashCode = prime * hashCode + ((getResources() == null) ? 0 : getResources().hashCode()); hashCode = prime * hashCode + ((getTier() == null) ? 0 : getTier().hashCode()); hashCode = prime * hashCode + ((getEnvironmentLinks() == null) ? 0 : getEnvironmentLinks().hashCode()); hashCode = prime * hashCode + ((getEnvironmentArn() == null) ? 0 : getEnvironmentArn().hashCode()); return hashCode; }
return false; CreateEnvironmentResult other = (CreateEnvironmentResult) obj; if (other.getEnvironmentName() == null ^ this.getEnvironmentName() == null) return false; if (other.getEnvironmentName() != null && other.getEnvironmentName().equals(this.getEnvironmentName()) == false) return false; if (other.getEnvironmentId() == null ^ this.getEnvironmentId() == null) return false; if (other.getEnvironmentId() != null && other.getEnvironmentId().equals(this.getEnvironmentId()) == 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.getVersionLabel() == null ^ this.getVersionLabel() == null) return false; if (other.getVersionLabel() != null && other.getVersionLabel().equals(this.getVersionLabel()) == false) return false; if (other.getSolutionStackName() == null ^ this.getSolutionStackName() == null) return false; if (other.getSolutionStackName() != null && other.getSolutionStackName().equals(this.getSolutionStackName()) == false) return false; if (other.getPlatformArn() == null ^ this.getPlatformArn() == null) return false; if (other.getPlatformArn() != null && other.getPlatformArn().equals(this.getPlatformArn()) == false) return false; if (other.getTemplateName() == null ^ this.getTemplateName() == null) return false; if (other.getTemplateName() != null && other.getTemplateName().equals(this.getTemplateName()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEnvironmentName() != null) sb.append("EnvironmentName: ").append(getEnvironmentName()).append(","); if (getEnvironmentId() != null) sb.append("EnvironmentId: ").append(getEnvironmentId()).append(","); if (getApplicationName() != null) sb.append("ApplicationName: ").append(getApplicationName()).append(","); if (getVersionLabel() != null) sb.append("VersionLabel: ").append(getVersionLabel()).append(","); if (getSolutionStackName() != null) sb.append("SolutionStackName: ").append(getSolutionStackName()).append(","); if (getPlatformArn() != null) sb.append("PlatformArn: ").append(getPlatformArn()).append(","); if (getTemplateName() != null) sb.append("TemplateName: ").append(getTemplateName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getEndpointURL() != null) sb.append("EndpointURL: ").append(getEndpointURL()).append(","); if (getCNAME() != null) sb.append("CNAME: ").append(getCNAME()).append(","); if (getDateCreated() != null) sb.append("DateCreated: ").append(getDateCreated()).append(","); if (getDateUpdated() != null) sb.append("DateUpdated: ").append(getDateUpdated()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getAbortableOperationInProgress() != null)