public HealthCheck unmarshall(StaxUnmarshallerContext context) throws Exception { HealthCheck healthCheck = new HealthCheck(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; healthCheck.setTarget(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; healthCheck.setInterval(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; healthCheck.setTimeout(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; healthCheck.setUnhealthyThreshold(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; healthCheck.setHealthyThreshold(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode()); hashCode = prime * hashCode + ((getInterval() == null) ? 0 : getInterval().hashCode()); hashCode = prime * hashCode + ((getTimeout() == null) ? 0 : getTimeout().hashCode()); hashCode = prime * hashCode + ((getUnhealthyThreshold() == null) ? 0 : getUnhealthyThreshold().hashCode()); hashCode = prime * hashCode + ((getHealthyThreshold() == null) ? 0 : getHealthyThreshold().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHealthCheck() == null) ? 0 : getHealthCheck().hashCode()); return hashCode; }
setTarget(target); setInterval(interval); setTimeout(timeout); setUnhealthyThreshold(unhealthyThreshold); setHealthyThreshold(healthyThreshold);
private void configureHealthCheck(AmazonElasticLoadBalancing loadBalancing, LoadBalancerDescription source, String loadBalancerName) { HealthCheck healthCheck = new HealthCheck() .withTarget(source.getHealthCheck().getTarget()) .withInterval(source.getHealthCheck().getInterval()) .withTimeout(source.getHealthCheck().getTimeout()) .withUnhealthyThreshold(source.getHealthCheck().getUnhealthyThreshold()) .withHealthyThreshold(source.getHealthCheck().getHealthyThreshold()); loadBalancing.configureHealthCheck(new ConfigureHealthCheckRequest(loadBalancerName, healthCheck)); }
/** * Sets up the heath check on the given load balancer. * The target should be in format protocol:port/path (e.g. http:8080/index.html) * * @param loadBalancerName * @param target * @param healthyThresh * @param unhealthyThresh * @param interval * @param timeout * @param elbClient */ public void setupHealthCheck(String loadBalancerName, String target, int healthyThresh, int unhealthyThresh, int interval, int timeout, AmazonElasticLoadBalancing elbClient) { HealthCheck hCheck = new HealthCheck() .withTarget(target) .withHealthyThreshold(healthyThresh) .withUnhealthyThreshold(unhealthyThresh) .withInterval(interval) .withTimeout(timeout); ConfigureHealthCheckRequest healthRequest = new ConfigureHealthCheckRequest() .withHealthCheck(hCheck) .withLoadBalancerName(loadBalancerName); @SuppressWarnings("unused") ConfigureHealthCheckResult healthResult = elbClient.configureHealthCheck(healthRequest); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ConfigureHealthCheckResult == false) return false; ConfigureHealthCheckResult other = (ConfigureHealthCheckResult) obj; if (other.getHealthCheck() == null ^ this.getHealthCheck() == null) return false; if (other.getHealthCheck() != null && other.getHealthCheck().equals(this.getHealthCheck()) == false) return false; return true; }
/** * <p> * The approximate interval, in seconds, between health checks of an individual instance. * </p> * * @param interval * The approximate interval, in seconds, between health checks of an individual instance. * @return Returns a reference to this object so that method calls can be chained together. */ public HealthCheck withInterval(Integer interval) { setInterval(interval); return this; }
/** * <p> * The number of consecutive health checks successes required before moving the instance to the <code>Healthy</code> * state. * </p> * * @param healthyThreshold * The number of consecutive health checks successes required before moving the instance to the * <code>Healthy</code> state. * @return Returns a reference to this object so that method calls can be chained together. */ public HealthCheck withHealthyThreshold(Integer healthyThreshold) { setHealthyThreshold(healthyThreshold); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ConfigureHealthCheckRequest == false) return false; ConfigureHealthCheckRequest other = (ConfigureHealthCheckRequest) obj; if (other.getLoadBalancerName() == null ^ this.getLoadBalancerName() == null) return false; if (other.getLoadBalancerName() != null && other.getLoadBalancerName().equals(this.getLoadBalancerName()) == false) return false; if (other.getHealthCheck() == null ^ this.getHealthCheck() == null) return false; if (other.getHealthCheck() != null && other.getHealthCheck().equals(this.getHealthCheck()) == false) return false; return true; }
/** * <p> * The approximate interval, in seconds, between health checks of an individual instance. * </p> * * @param interval * The approximate interval, in seconds, between health checks of an individual instance. * @return Returns a reference to this object so that method calls can be chained together. */ public HealthCheck withInterval(Integer interval) { setInterval(interval); return this; }
/** * <p> * The number of consecutive health checks successes required before moving the instance to the <code>Healthy</code> * state. * </p> * * @param healthyThreshold * The number of consecutive health checks successes required before moving the instance to the * <code>Healthy</code> state. * @return Returns a reference to this object so that method calls can be chained together. */ public HealthCheck withHealthyThreshold(Integer healthyThreshold) { setHealthyThreshold(healthyThreshold); return this; }
return false; HealthCheck other = (HealthCheck) obj; if (other.getTarget() == null ^ this.getTarget() == null) return false; if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false) return false; if (other.getInterval() == null ^ this.getInterval() == null) return false; if (other.getInterval() != null && other.getInterval().equals(this.getInterval()) == false) return false; if (other.getTimeout() == null ^ this.getTimeout() == null) return false; if (other.getTimeout() != null && other.getTimeout().equals(this.getTimeout()) == false) return false; if (other.getUnhealthyThreshold() == null ^ this.getUnhealthyThreshold() == null) return false; if (other.getUnhealthyThreshold() != null && other.getUnhealthyThreshold().equals(this.getUnhealthyThreshold()) == false) return false; if (other.getHealthyThreshold() == null ^ this.getHealthyThreshold() == null) return false; if (other.getHealthyThreshold() != null && other.getHealthyThreshold().equals(this.getHealthyThreshold()) == false) return false; return true;
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerName() == null) ? 0 : getLoadBalancerName().hashCode()); hashCode = prime * hashCode + ((getHealthCheck() == null) ? 0 : getHealthCheck().hashCode()); return hashCode; }
if (other.getHealthCheck() == null ^ this.getHealthCheck() == null) return false; if (other.getHealthCheck() != null && other.getHealthCheck().equals(this.getHealthCheck()) == false) return false; if (other.getSourceSecurityGroup() == null ^ this.getSourceSecurityGroup() == null)
/** * 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 (getTarget() != null) sb.append("Target: ").append(getTarget()).append(","); if (getInterval() != null) sb.append("Interval: ").append(getInterval()).append(","); if (getTimeout() != null) sb.append("Timeout: ").append(getTimeout()).append(","); if (getUnhealthyThreshold() != null) sb.append("UnhealthyThreshold: ").append(getUnhealthyThreshold()).append(","); if (getHealthyThreshold() != null) sb.append("HealthyThreshold: ").append(getHealthyThreshold()); sb.append("}"); return sb.toString(); }
setTarget(target); setInterval(interval); setTimeout(timeout); setUnhealthyThreshold(unhealthyThreshold); setHealthyThreshold(healthyThreshold);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerName() == null) ? 0 : getLoadBalancerName().hashCode()); hashCode = prime * hashCode + ((getDNSName() == null) ? 0 : getDNSName().hashCode()); hashCode = prime * hashCode + ((getCanonicalHostedZoneName() == null) ? 0 : getCanonicalHostedZoneName().hashCode()); hashCode = prime * hashCode + ((getCanonicalHostedZoneNameID() == null) ? 0 : getCanonicalHostedZoneNameID().hashCode()); hashCode = prime * hashCode + ((getListenerDescriptions() == null) ? 0 : getListenerDescriptions().hashCode()); hashCode = prime * hashCode + ((getPolicies() == null) ? 0 : getPolicies().hashCode()); hashCode = prime * hashCode + ((getBackendServerDescriptions() == null) ? 0 : getBackendServerDescriptions().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); hashCode = prime * hashCode + ((getSubnets() == null) ? 0 : getSubnets().hashCode()); hashCode = prime * hashCode + ((getVPCId() == null) ? 0 : getVPCId().hashCode()); hashCode = prime * hashCode + ((getInstances() == null) ? 0 : getInstances().hashCode()); hashCode = prime * hashCode + ((getHealthCheck() == null) ? 0 : getHealthCheck().hashCode()); hashCode = prime * hashCode + ((getSourceSecurityGroup() == null) ? 0 : getSourceSecurityGroup().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode()); hashCode = prime * hashCode + ((getScheme() == null) ? 0 : getScheme().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ConfigureHealthCheckResult == false) return false; ConfigureHealthCheckResult other = (ConfigureHealthCheckResult) obj; if (other.getHealthCheck() == null ^ this.getHealthCheck() == null) return false; if (other.getHealthCheck() != null && other.getHealthCheck().equals(this.getHealthCheck()) == false) return false; return true; } }
if (healthCheck != null) { if (healthCheck.getTarget() != null) { request.addParameter("HealthCheck.Target", StringUtils.fromString(healthCheck.getTarget())); if (healthCheck.getInterval() != null) { request.addParameter("HealthCheck.Interval", StringUtils.fromInteger(healthCheck.getInterval())); if (healthCheck.getTimeout() != null) { request.addParameter("HealthCheck.Timeout", StringUtils.fromInteger(healthCheck.getTimeout())); if (healthCheck.getUnhealthyThreshold() != null) { request.addParameter("HealthCheck.UnhealthyThreshold", StringUtils.fromInteger(healthCheck.getUnhealthyThreshold())); if (healthCheck.getHealthyThreshold() != null) { request.addParameter("HealthCheck.HealthyThreshold", StringUtils.fromInteger(healthCheck.getHealthyThreshold()));