setLoadBalancerName(loadBalancerName); setListeners(listeners); setAvailabilityZones(availabilityZones);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerName() == null) ? 0 : getLoadBalancerName().hashCode()); hashCode = prime * hashCode + ((getListeners() == null) ? 0 : getListeners().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); hashCode = prime * hashCode + ((getSubnets() == null) ? 0 : getSubnets().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getScheme() == null) ? 0 : getScheme().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
//create load balancer CreateLoadBalancerRequest lbRequest = new CreateLoadBalancerRequest(); lbRequest.setLoadBalancerName("loader"); List<Listener> listeners = new ArrayList<Listener>(1); listeners.add(new Listener("HTTP", 80, 80)); lbRequest.withAvailabilityZones(availabilityZone1,availabilityZone2); lbRequest.setListeners(listeners); CreateLoadBalancerResult lbResult=elb.createLoadBalancer(lbRequest); System.out.println("created load balancer loader");
List<String> zones, AmazonElasticLoadBalancing lbClient) throws EnvironmentCreationException { CreateLoadBalancerRequest request = new CreateLoadBalancerRequest() .withLoadBalancerName(loadBalancerName); if (subnets != null && !subnets.isEmpty()) { request = request.withSubnets(subnets); request = request.withAvailabilityZones(zones); request = request.withListeners(listeners); request = request.withSecurityGroups(secGroups);
/** * Constructs a new CreateLoadBalancerRequest 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.</p> * <p> * This name must be unique within your set of load balancers for the region, must have a maximum of 32 * characters, must contain only alphanumeric characters or hyphens, and cannot begin or end with a hyphen. */ public CreateLoadBalancerRequest(String loadBalancerName) { setLoadBalancerName(loadBalancerName); }
/** * <p> * The listeners. * </p> * <p> * For more information, see <a * href="http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html">Listeners for Your * Classic Load Balancer</a> in the <i>Classic Load Balancers Guide</i>. * </p> * * @param listeners * The listeners.</p> * <p> * For more information, see <a * href="http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html">Listeners * for Your Classic Load Balancer</a> in the <i>Classic Load Balancers Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withListeners(java.util.Collection<Listener> listeners) { setListeners(listeners); return this; }
/** * <p> * The IDs of the security groups to assign to the load balancer. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param securityGroups <p> * The IDs of the security groups to assign to the load balancer. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CreateLoadBalancerRequest withSecurityGroups(String... securityGroups) { if (getSecurityGroups() == null) { this.securityGroups = new java.util.ArrayList<String>(securityGroups.length); } for (String value : securityGroups) { this.securityGroups.add(value); } return this; }
/** * <p> * The IDs of the subnets in your VPC to attach to the load balancer. * Specify one subnet per Availability Zone specified in * <code>AvailabilityZones</code>. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param subnets <p> * The IDs of the subnets in your VPC to attach to the load * balancer. Specify one subnet per Availability Zone specified * in <code>AvailabilityZones</code>. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CreateLoadBalancerRequest withSubnets(String... subnets) { if (getSubnets() == null) { this.subnets = new java.util.ArrayList<String>(subnets.length); } for (String value : subnets) { this.subnets.add(value); } return this; }
if (getListeners() == null) { this.listeners = new java.util.ArrayList<Listener>(listeners.length);
if (getAvailabilityZones() == null) { this.availabilityZones = new java.util.ArrayList<String>(availabilityZones.length);
String createLoadBalancer(String name) { CreateLoadBalancerRequest request = new CreateLoadBalancerRequest(); request.setLoadBalancerName(name); request.withAvailabilityZones(elbAvailabilityZones.split(",")); List<Listener> listeners = new ArrayList<Listener>(); listeners.add(new Listener(elbProtocol, elbPortIn, elbPortOut)); request.setListeners(listeners); CreateLoadBalancerResult lbResult = elb.createLoadBalancer(request); appendText(lbResult.getDNSName() + NEW_LINE, elbFile); return request.getLoadBalancerName(); }
/** * <p> * The name of the load balancer. * </p> * <p> * This name must be unique within your set of load balancers for the region, must have a maximum of 32 characters, * must contain only alphanumeric characters or hyphens, and cannot begin or end with a hyphen. * </p> * * @param loadBalancerName * The name of the load balancer.</p> * <p> * This name must be unique within your set of load balancers for the region, must have a maximum of 32 * characters, must contain only alphanumeric characters or hyphens, and cannot begin or end with a hyphen. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withLoadBalancerName(String loadBalancerName) { setLoadBalancerName(loadBalancerName); return this; }
setListeners(new com.amazonaws.internal.SdkInternalList<Listener>(listeners.length));
return false; CreateLoadBalancerRequest other = (CreateLoadBalancerRequest) obj; if (other.getLoadBalancerName() == null ^ this.getLoadBalancerName() == null) return false; if (other.getLoadBalancerName() != null && other.getLoadBalancerName().equals(this.getLoadBalancerName()) == false) return false; if (other.getListeners() == null ^ this.getListeners() == null) return false; if (other.getListeners() != null && other.getListeners().equals(this.getListeners()) == false) return false; if (other.getAvailabilityZones() == null ^ this.getAvailabilityZones() == null) return false; if (other.getAvailabilityZones() != null && other.getAvailabilityZones().equals(this.getAvailabilityZones()) == false) return false; if (other.getSubnets() == null ^ this.getSubnets() == null) return false; if (other.getSubnets() != null && other.getSubnets().equals(this.getSubnets()) == false) return false; if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null) return false; if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false) return false; if (other.getScheme() == null ^ this.getScheme() == null) return false; if (other.getScheme() != null && other.getScheme().equals(this.getScheme()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
setLoadBalancerName(loadBalancerName); setListeners(listeners); setAvailabilityZones(availabilityZones);
/** * Constructs a new CreateLoadBalancerRequest 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> * <p> * This name must be unique within your set of load balancers for * the region, must have a maximum of 32 characters, must contain * only alphanumeric characters or hyphens, and cannot begin or * end with a hyphen. * </p> */ public CreateLoadBalancerRequest(String loadBalancerName) { setLoadBalancerName(loadBalancerName); }
/** * <p> * The listeners. * </p> * <p> * For more information, see <a href= * "http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html" * >Listeners for Your Classic Load Balancer</a> in the <i>Classic Load * Balancers Guide</i>. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param listeners <p> * The listeners. * </p> * <p> * For more information, see <a href= * "http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html" * >Listeners for Your Classic Load Balancer</a> in the * <i>Classic Load Balancers Guide</i>. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CreateLoadBalancerRequest withListeners(java.util.Collection<Listener> listeners) { setListeners(listeners); 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 (getListeners() != null) sb.append("Listeners: ").append(getListeners()).append(","); if (getAvailabilityZones() != null) sb.append("AvailabilityZones: ").append(getAvailabilityZones()).append(","); if (getSubnets() != null) sb.append("Subnets: ").append(getSubnets()).append(","); if (getSecurityGroups() != null) sb.append("SecurityGroups: ").append(getSecurityGroups()).append(","); if (getScheme() != null) sb.append("Scheme: ").append(getScheme()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); }
setLoadBalancerName(loadBalancerName); setListeners(listeners); setAvailabilityZones(availabilityZones);
/** * Constructs a new CreateLoadBalancerRequest 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.</p> * <p> * This name must be unique within your set of load balancers for the region, must have a maximum of 32 * characters, must contain only alphanumeric characters or hyphens, and cannot begin or end with a hyphen. */ public CreateLoadBalancerRequest(String loadBalancerName) { setLoadBalancerName(loadBalancerName); }