@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeploymentId() == null) ? 0 : getDeploymentId().hashCode()); hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); hashCode = prime * hashCode + ((getAppId() == null) ? 0 : getAppId().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getCompletedAt() == null) ? 0 : getCompletedAt().hashCode()); hashCode = prime * hashCode + ((getDuration() == null) ? 0 : getDuration().hashCode()); hashCode = prime * hashCode + ((getIamUserArn() == null) ? 0 : getIamUserArn().hashCode()); hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getCustomJson() == null) ? 0 : getCustomJson().hashCode()); hashCode = prime * hashCode + ((getInstanceIds() == null) ? 0 : getInstanceIds().hashCode()); return hashCode; }
public Deployment unmarshall(JsonUnmarshallerContext context) throws Exception { Deployment deployment = new Deployment(); if (context.testExpression("DeploymentId", targetDepth)) { context.nextToken(); deployment.setDeploymentId(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setStackId(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setAppId(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCreatedAt(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCompletedAt(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setDuration(context.getUnmarshaller(Integer.class).unmarshall(context)); deployment.setIamUserArn(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setComment(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCommand(DeploymentCommandJsonUnmarshaller.getInstance().unmarshall(context)); deployment.setStatus(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCustomJson(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setInstanceIds(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));
.getDeployments(); for (Deployment deployment : deployments) { String status = deployment.getStatus(); System.out.println(deployment.getDeploymentId() + " : " + status); if (status.equalsIgnoreCase("failed")) { throw new BuildException("Deployment " + deployment.getDeploymentId() + " failed"); } else if (status.equalsIgnoreCase("successful")) { deploymentIds.remove(deployment.getDeploymentId());
public static boolean wasSuccessfulDeployment(AWSOpsWorksClient opsClient, String deploymentId) { while (true) { Deployment deployment = opsClient .describeDeployments( new DescribeDeploymentsRequest() .withDeploymentIds(deploymentId)) .getDeployments().get(0); if (deployment.getStatus().equalsIgnoreCase("successful")) { System.out.println("Deployment " + deploymentId + " was successful"); return true; } else if (deployment.getStatus().equalsIgnoreCase("failed")) { return false; } } }
public Deployment unmarshall(JsonUnmarshallerContext context) throws Exception { Deployment deployment = new Deployment(); if (context.testExpression("DeploymentId", targetDepth)) { context.nextToken(); deployment.setDeploymentId(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setStackId(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setAppId(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCreatedAt(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCompletedAt(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setDuration(context.getUnmarshaller(Integer.class).unmarshall(context)); deployment.setIamUserArn(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setComment(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCommand(DeploymentCommandJsonUnmarshaller.getInstance().unmarshall(context)); deployment.setStatus(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setCustomJson(context.getUnmarshaller(String.class).unmarshall(context)); deployment.setInstanceIds(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));
return false; Deployment other = (Deployment) obj; if (other.getDeploymentId() == null ^ this.getDeploymentId() == null) return false; if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == false) return false; if (other.getStackId() == null ^ this.getStackId() == null) return false; if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; if (other.getAppId() == null ^ this.getAppId() == null) return false; if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getCompletedAt() == null ^ this.getCompletedAt() == null) return false; if (other.getCompletedAt() != null && other.getCompletedAt().equals(this.getCompletedAt()) == false) return false; if (other.getDuration() == null ^ this.getDuration() == null) return false; if (other.getDuration() != null && other.getDuration().equals(this.getDuration()) == false) return false; if (other.getIamUserArn() == null ^ this.getIamUserArn() == null) return false; if (other.getIamUserArn() != null && other.getIamUserArn().equals(this.getIamUserArn()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDeploymentId() != null) sb.append("DeploymentId: ").append(getDeploymentId()).append(","); if (getStackId() != null) sb.append("StackId: ").append(getStackId()).append(","); if (getAppId() != null) sb.append("AppId: ").append(getAppId()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getCompletedAt() != null) sb.append("CompletedAt: ").append(getCompletedAt()).append(","); if (getDuration() != null) sb.append("Duration: ").append(getDuration()).append(","); if (getIamUserArn() != null) sb.append("IamUserArn: ").append(getIamUserArn()).append(","); if (getComment() != null) sb.append("Comment: ").append(getComment()).append(","); if (getCommand() != null) sb.append("Command: ").append(getCommand()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getCustomJson() != null) sb.append("CustomJson: ").append(getCustomJson()).append(","); if (getInstanceIds() != null) sb.append("InstanceIds: ").append(getInstanceIds()); sb.append("}"); return sb.toString();
/** * Marshall the given parameter object. */ public void marshall(Deployment deployment, ProtocolMarshaller protocolMarshaller) { if (deployment == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deployment.getDeploymentId(), DEPLOYMENTID_BINDING); protocolMarshaller.marshall(deployment.getStackId(), STACKID_BINDING); protocolMarshaller.marshall(deployment.getAppId(), APPID_BINDING); protocolMarshaller.marshall(deployment.getCreatedAt(), CREATEDAT_BINDING); protocolMarshaller.marshall(deployment.getCompletedAt(), COMPLETEDAT_BINDING); protocolMarshaller.marshall(deployment.getDuration(), DURATION_BINDING); protocolMarshaller.marshall(deployment.getIamUserArn(), IAMUSERARN_BINDING); protocolMarshaller.marshall(deployment.getComment(), COMMENT_BINDING); protocolMarshaller.marshall(deployment.getCommand(), COMMAND_BINDING); protocolMarshaller.marshall(deployment.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(deployment.getCustomJson(), CUSTOMJSON_BINDING); protocolMarshaller.marshall(deployment.getInstanceIds(), INSTANCEIDS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeploymentId() == null) ? 0 : getDeploymentId().hashCode()); hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); hashCode = prime * hashCode + ((getAppId() == null) ? 0 : getAppId().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getCompletedAt() == null) ? 0 : getCompletedAt().hashCode()); hashCode = prime * hashCode + ((getDuration() == null) ? 0 : getDuration().hashCode()); hashCode = prime * hashCode + ((getIamUserArn() == null) ? 0 : getIamUserArn().hashCode()); hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getCustomJson() == null) ? 0 : getCustomJson().hashCode()); hashCode = prime * hashCode + ((getInstanceIds() == null) ? 0 : getInstanceIds().hashCode()); return hashCode; }
return false; Deployment other = (Deployment) obj; if (other.getDeploymentId() == null ^ this.getDeploymentId() == null) return false; if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == false) return false; if (other.getStackId() == null ^ this.getStackId() == null) return false; if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; if (other.getAppId() == null ^ this.getAppId() == null) return false; if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getCompletedAt() == null ^ this.getCompletedAt() == null) return false; if (other.getCompletedAt() != null && other.getCompletedAt().equals(this.getCompletedAt()) == false) return false; if (other.getDuration() == null ^ this.getDuration() == null) return false; if (other.getDuration() != null && other.getDuration().equals(this.getDuration()) == false) return false; if (other.getIamUserArn() == null ^ this.getIamUserArn() == null) return false; if (other.getIamUserArn() != null && other.getIamUserArn().equals(this.getIamUserArn()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDeploymentId() != null) sb.append("DeploymentId: ").append(getDeploymentId()).append(","); if (getStackId() != null) sb.append("StackId: ").append(getStackId()).append(","); if (getAppId() != null) sb.append("AppId: ").append(getAppId()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getCompletedAt() != null) sb.append("CompletedAt: ").append(getCompletedAt()).append(","); if (getDuration() != null) sb.append("Duration: ").append(getDuration()).append(","); if (getIamUserArn() != null) sb.append("IamUserArn: ").append(getIamUserArn()).append(","); if (getComment() != null) sb.append("Comment: ").append(getComment()).append(","); if (getCommand() != null) sb.append("Command: ").append(getCommand()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getCustomJson() != null) sb.append("CustomJson: ").append(getCustomJson()).append(","); if (getInstanceIds() != null) sb.append("InstanceIds: ").append(getInstanceIds()); sb.append("}"); return sb.toString();
/** * Marshall the given parameter object. */ public void marshall(Deployment deployment, ProtocolMarshaller protocolMarshaller) { if (deployment == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deployment.getDeploymentId(), DEPLOYMENTID_BINDING); protocolMarshaller.marshall(deployment.getStackId(), STACKID_BINDING); protocolMarshaller.marshall(deployment.getAppId(), APPID_BINDING); protocolMarshaller.marshall(deployment.getCreatedAt(), CREATEDAT_BINDING); protocolMarshaller.marshall(deployment.getCompletedAt(), COMPLETEDAT_BINDING); protocolMarshaller.marshall(deployment.getDuration(), DURATION_BINDING); protocolMarshaller.marshall(deployment.getIamUserArn(), IAMUSERARN_BINDING); protocolMarshaller.marshall(deployment.getComment(), COMMENT_BINDING); protocolMarshaller.marshall(deployment.getCommand(), COMMAND_BINDING); protocolMarshaller.marshall(deployment.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(deployment.getCustomJson(), CUSTOMJSON_BINDING); protocolMarshaller.marshall(deployment.getInstanceIds(), INSTANCEIDS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }