@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerName() == null) ? 0 : getLoadBalancerName().hashCode()); hashCode = prime * hashCode + ((getInstances() == null) ? 0 : getInstances().hashCode()); return hashCode; }
/** * Constructs a new DeregisterInstancesFromLoadBalancerRequest object. Callers should use the setter or fluent * setter (with...) methods to initialize any additional object members. * * @param loadBalancerName * The name of the load balancer. * @param instances * The IDs of the instances. */ public DeregisterInstancesFromLoadBalancerRequest(String loadBalancerName, java.util.List<Instance> instances) { setLoadBalancerName(loadBalancerName); setInstances(instances); }
/** * * @param loadBalancerName * @param instances * @param lbClient * @return */ public List<com.amazonaws.services.elasticloadbalancing.model.Instance> deregisterInstancesLB(String loadBalancerName, List<com.amazonaws.services.elasticloadbalancing.model.Instance> instances, AmazonElasticLoadBalancing lbClient) { DeregisterInstancesFromLoadBalancerRequest request = new DeregisterInstancesFromLoadBalancerRequest() .withInstances(instances) .withLoadBalancerName(loadBalancerName); DeregisterInstancesFromLoadBalancerResult result = lbClient.deregisterInstancesFromLoadBalancer(request); return result.getInstances(); }
/** * <p> * The IDs of the instances. * </p> * * @param instances * The IDs of the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DeregisterInstancesFromLoadBalancerRequest withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }
/** * <p> * The name of the load balancer. * </p> * * @param loadBalancerName * The name of the load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public DeregisterInstancesFromLoadBalancerRequest withLoadBalancerName(String loadBalancerName) { setLoadBalancerName(loadBalancerName); return this; }
/** * <p> * The IDs of the instances. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param instances <p> * The IDs of the instances. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DeregisterInstancesFromLoadBalancerRequest withInstances(Instance... instances) { if (getInstances() == null) { this.instances = new java.util.ArrayList<Instance>(instances.length); } for (Instance value : instances) { this.instances.add(value); } return this; }
public Observable<String> deRegisterInstanceFromLoadbalancer(String loadBalancer) { if (instanceId == null || loadBalancer == null) { LOG.error("Unable to register instance {}, on load balancer {}.", instanceId, loadBalancer); throw new IllegalStateException(); } try { return Observable.from(elbAsyncClient.deregisterInstancesFromLoadBalancerAsync(new DeregisterInstancesFromLoadBalancerRequest().withLoadBalancerName(loadBalancer).withInstances(new Instance().withInstanceId(instanceId)))) .flatMap(x -> Observable.just(loadBalancer)); } catch (AmazonClientException e) { LOG.error(LogConstants.ERROR_EXECUTING_REQUEST, e); throw new AwsException(e); } }
/** * <p> * The IDs of the instances. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. * </p> * * @param instances * The IDs of the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DeregisterInstancesFromLoadBalancerRequest withInstances(Instance... instances) { if (this.instances == null) { setInstances(new com.amazonaws.internal.SdkInternalList<Instance>(instances.length)); } for (Instance ele : instances) { this.instances.add(ele); } return this; }
/** * <p> * The name of the load balancer. * </p> * * @param loadBalancerName * The name of the load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public DeregisterInstancesFromLoadBalancerRequest withLoadBalancerName(String loadBalancerName) { setLoadBalancerName(loadBalancerName); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeregisterInstancesFromLoadBalancerRequest == false) return false; DeregisterInstancesFromLoadBalancerRequest other = (DeregisterInstancesFromLoadBalancerRequest) obj; if (other.getLoadBalancerName() == null ^ this.getLoadBalancerName() == null) return false; if (other.getLoadBalancerName() != null && other.getLoadBalancerName().equals(this.getLoadBalancerName()) == false) return false; if (other.getInstances() == null ^ this.getInstances() == null) return false; if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false) return false; return true; }
/** * Constructs a new DeregisterInstancesFromLoadBalancerRequest object. * Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param loadBalancerName <p> * The name of the load balancer. * </p> * @param instances <p> * The IDs of the instances. * </p> */ public DeregisterInstancesFromLoadBalancerRequest(String loadBalancerName, java.util.List<Instance> instances) { setLoadBalancerName(loadBalancerName); setInstances(instances); }
/** * <p> * The IDs of the instances. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param instances <p> * The IDs of the instances. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DeregisterInstancesFromLoadBalancerRequest withInstances( java.util.Collection<Instance> instances) { setInstances(instances); return this; }
/** * 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 (getLoadBalancerName() != null) sb.append("LoadBalancerName: ").append(getLoadBalancerName()).append(","); if (getInstances() != null) sb.append("Instances: ").append(getInstances()); sb.append("}"); return sb.toString(); }
/** * Constructs a new DeregisterInstancesFromLoadBalancerRequest object. Callers should use the setter or fluent * setter (with...) methods to initialize any additional object members. * * @param loadBalancerName * The name of the load balancer. * @param instances * The IDs of the instances. */ public DeregisterInstancesFromLoadBalancerRequest(String loadBalancerName, java.util.List<Instance> instances) { setLoadBalancerName(loadBalancerName); setInstances(instances); }
/** * <p> * The IDs of the instances. * </p> * * @param instances * The IDs of the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DeregisterInstancesFromLoadBalancerRequest withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }
public Request<DeregisterInstancesFromLoadBalancerRequest> marshall(DeregisterInstancesFromLoadBalancerRequest deregisterInstancesFromLoadBalancerRequest) { if (deregisterInstancesFromLoadBalancerRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DeregisterInstancesFromLoadBalancerRequest> request = new DefaultRequest<DeregisterInstancesFromLoadBalancerRequest>( deregisterInstancesFromLoadBalancerRequest, "AmazonElasticLoadBalancing"); request.addParameter("Action", "DeregisterInstancesFromLoadBalancer"); request.addParameter("Version", "2012-06-01"); request.setHttpMethod(HttpMethodName.POST); if (deregisterInstancesFromLoadBalancerRequest.getLoadBalancerName() != null) { request.addParameter("LoadBalancerName", StringUtils.fromString(deregisterInstancesFromLoadBalancerRequest.getLoadBalancerName())); } if (!deregisterInstancesFromLoadBalancerRequest.getInstances().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Instance>) deregisterInstancesFromLoadBalancerRequest.getInstances()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<Instance> instancesList = (com.amazonaws.internal.SdkInternalList<Instance>) deregisterInstancesFromLoadBalancerRequest .getInstances(); int instancesListIndex = 1; for (Instance instancesListValue : instancesList) { if (instancesListValue.getInstanceId() != null) { request.addParameter("Instances.member." + instancesListIndex + ".InstanceId", StringUtils.fromString(instancesListValue.getInstanceId())); } instancesListIndex++; } } return request; }
/** * <p> * The IDs of the instances. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. * </p> * * @param instances * The IDs of the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DeregisterInstancesFromLoadBalancerRequest withInstances(Instance... instances) { if (this.instances == null) { setInstances(new com.amazonaws.internal.SdkInternalList<Instance>(instances.length)); } for (Instance ele : instances) { this.instances.add(ele); } return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerName() == null) ? 0 : getLoadBalancerName().hashCode()); hashCode = prime * hashCode + ((getInstances() == null) ? 0 : getInstances().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeregisterInstancesFromLoadBalancerRequest == false) return false; DeregisterInstancesFromLoadBalancerRequest other = (DeregisterInstancesFromLoadBalancerRequest) obj; if (other.getLoadBalancerName() == null ^ this.getLoadBalancerName() == null) return false; if (other.getLoadBalancerName() != null && other.getLoadBalancerName().equals(this.getLoadBalancerName()) == false) return false; if (other.getInstances() == null ^ this.getInstances() == null) return false; if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getLoadBalancerName() != null) sb.append("LoadBalancerName: " + getLoadBalancerName() + ","); if (getInstances() != null) sb.append("Instances: " + getInstances()); sb.append("}"); return sb.toString(); }