if (getVPCId() != null) sb.append("VPCId: ").append(getVPCId()).append(","); if (getInstances() != null) sb.append("Instances: ").append(getInstances()).append(","); if (getHealthCheck() != null) sb.append("HealthCheck: ").append(getHealthCheck()).append(",");
/** {@inheritDoc} */ @Override public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException { initClients(); List<String> instanceIds = new ArrayList<>(); DescribeLoadBalancersRequest req = new DescribeLoadBalancersRequest().withLoadBalancerNames(loadBalancerName); List<LoadBalancerDescription> descs = amazonELBClient.describeLoadBalancers(req).getLoadBalancerDescriptions(); for (LoadBalancerDescription desc : descs) { for (Instance instance : desc.getInstances()) instanceIds.add(instance.getInstanceId()); } DescribeInstancesRequest instReq = new DescribeInstancesRequest().withInstanceIds(instanceIds); List<Reservation> reservations = amazonEC2Client.describeInstances(instReq).getReservations(); List<InetSocketAddress> addrs = new ArrayList<>(); for (Reservation reservation : reservations) { List<com.amazonaws.services.ec2.model.Instance> instances = reservation.getInstances(); for (com.amazonaws.services.ec2.model.Instance instance : instances) addrs.add(new InetSocketAddress(instance.getPrivateIpAddress(), 0)); } return addrs; }
@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; }
if (other.getVPCId() != null && other.getVPCId().equals(this.getVPCId()) == false) return false; if (other.getInstances() == null ^ this.getInstances() == null) return false; if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false) return false; if (other.getHealthCheck() == null ^ this.getHealthCheck() == null)
/** * <p> * The IDs of the instances for the load balancer. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param instances <p> * The IDs of the instances for the load balancer. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public LoadBalancerDescription 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; }
if (getVPCId() != null) sb.append("VPCId: " + getVPCId() + ","); if (getInstances() != null) sb.append("Instances: " + getInstances() + ","); if (getHealthCheck() != null) sb.append("HealthCheck: " + getHealthCheck() + ",");
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());
if (other.getVPCId() != null && other.getVPCId().equals(this.getVPCId()) == false) return false; if (other.getInstances() == null ^ this.getInstances() == null) return false; if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false) return false; if (other.getHealthCheck() == null ^ this.getHealthCheck() == null)
if (getVPCId() != null) sb.append("VPCId: ").append(getVPCId()).append(","); if (getInstances() != null) sb.append("Instances: ").append(getInstances()).append(","); if (getHealthCheck() != null) sb.append("HealthCheck: ").append(getHealthCheck()).append(",");
final String canonicalHostedZoneName = elb.getCanonicalHostedZoneName(); final List<String> instanceIds = elb.getInstances().stream().map(Instance::getInstanceId).collect(toList());
/** {@inheritDoc} */ @Override public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException { initClients(); List<String> instanceIds = new ArrayList<>(); DescribeLoadBalancersRequest req = new DescribeLoadBalancersRequest().withLoadBalancerNames(loadBalancerName); List<LoadBalancerDescription> descs = amazonELBClient.describeLoadBalancers(req).getLoadBalancerDescriptions(); for (LoadBalancerDescription desc : descs) { for (Instance instance : desc.getInstances()) instanceIds.add(instance.getInstanceId()); } DescribeInstancesRequest instReq = new DescribeInstancesRequest().withInstanceIds(instanceIds); List<Reservation> reservations = amazonEC2Client.describeInstances(instReq).getReservations(); List<InetSocketAddress> addrs = new ArrayList<>(); for (Reservation reservation : reservations) { List<com.amazonaws.services.ec2.model.Instance> instances = reservation.getInstances(); for (com.amazonaws.services.ec2.model.Instance instance : instances) addrs.add(new InetSocketAddress(instance.getPrivateIpAddress(), 0)); } return addrs; }
request.addParameter(prefix, StringUtils.fromString(vPCId)); if (_loadBalancerDescription.getInstances() != null) { prefix = _prefix + "Instances"; java.util.List<Instance> instances = _loadBalancerDescription.getInstances(); int instancesIndex = 1; String instancesPrefix = prefix;
@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; }
if (other.getVPCId() != null && other.getVPCId().equals(this.getVPCId()) == false) return false; if (other.getInstances() == null ^ this.getInstances() == null) return false; if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false) return false; if (other.getHealthCheck() == null ^ this.getHealthCheck() == null)