if (getCanonicalHostedZoneNameID() != null) sb.append("CanonicalHostedZoneNameID: ").append(getCanonicalHostedZoneNameID()).append(","); if (getListenerDescriptions() != null) sb.append("ListenerDescriptions: ").append(getListenerDescriptions()).append(","); if (getPolicies() != null) sb.append("Policies: ").append(getPolicies()).append(",");
@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.getCanonicalHostedZoneNameID() != null && other.getCanonicalHostedZoneNameID().equals(this.getCanonicalHostedZoneNameID()) == false) return false; if (other.getListenerDescriptions() == null ^ this.getListenerDescriptions() == null) return false; if (other.getListenerDescriptions() != null && other.getListenerDescriptions().equals(this.getListenerDescriptions()) == false) return false; if (other.getPolicies() == null ^ this.getPolicies() == null)
/** * <p> * The listeners for the load balancer. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param listenerDescriptions <p> * The listeners for the load balancer. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public LoadBalancerDescription withListenerDescriptions( ListenerDescription... listenerDescriptions) { if (getListenerDescriptions() == null) { this.listenerDescriptions = new java.util.ArrayList<ListenerDescription>( listenerDescriptions.length); } for (ListenerDescription value : listenerDescriptions) { this.listenerDescriptions.add(value); } return this; }
if (getCanonicalHostedZoneNameID() != null) sb.append("CanonicalHostedZoneNameID: " + getCanonicalHostedZoneNameID() + ","); if (getListenerDescriptions() != null) sb.append("ListenerDescriptions: " + getListenerDescriptions() + ","); if (getPolicies() != null) sb.append("Policies: " + getPolicies() + ",");
.hashCode()); hashCode = prime * hashCode + ((getListenerDescriptions() == null) ? 0 : getListenerDescriptions().hashCode()); hashCode = prime * hashCode + ((getPolicies() == null) ? 0 : getPolicies().hashCode()); hashCode = prime
&& other.getCanonicalHostedZoneNameID().equals(this.getCanonicalHostedZoneNameID()) == false) return false; if (other.getListenerDescriptions() == null ^ this.getListenerDescriptions() == null) return false; if (other.getListenerDescriptions() != null && other.getListenerDescriptions().equals(this.getListenerDescriptions()) == false) return false; if (other.getPolicies() == null ^ this.getPolicies() == null)
@Override public List<Integer> check(final LoadBalancerDescription loadBalancerDescription) { return loadBalancerDescription.getListenerDescriptions() .stream() .map(ListenerDescription::getListener) .map(Listener::getLoadBalancerPort) .filter(p -> !jobsProperties.getElbAllowedPorts().contains(p)) .collect(Collectors.toList()); }
public List<Listener> getListeners(LoadBalancerDescription sourceLoadBalancer, MigrateLoadBalancerResult result) { List<Listener> unmigratableListeners = sourceLoadBalancer.getListenerDescriptions().stream() .map(ListenerDescription::getListener) .filter(listenerCannotBeMigrated(source, target)).collect(Collectors.toList()); unmigratableListeners.forEach(l -> result.getWarnings().add( "The following listeners could not be created: " + l.getProtocol() + ":" + l.getLoadBalancerPort() + " => " + l.getInstanceProtocol() + ":" + l.getInstancePort() + " (certificate: " + l.getSSLCertificateId() + ")." )); List<Listener> listeners = sourceLoadBalancer.getListenerDescriptions().stream() .map(ListenerDescription::getListener) .filter(l -> l.getInstancePort() > 0) // strip out invalid load balancer listeners from legacy ELBs .collect(Collectors.toList()); listeners.removeAll(unmigratableListeners); return listeners; }
private List<ListenerDescription> describeMatchingElbListeners(String loadbalancerName, List<Integer> ports) { DescribeLoadBalancersResult loadbalancer = awsElbClient.describeLoadBalancers(new DescribeLoadBalancersRequest().withLoadBalancerNames(loadbalancerName)); LoadBalancerDescription description = loadbalancer.getLoadBalancerDescriptions().get(0); return description.getListenerDescriptions().stream() .filter(d -> ports.contains(d.getListener().getLoadBalancerPort())) .filter(d -> d.getListener().getProtocol().startsWith("HTTP")) .collect(Collectors.toList()); }
private ListenerDescription getExhibitorListenerDescription(LoadBalancerDescription loadBalancer) { for(ListenerDescription listenerDescription:loadBalancer.getListenerDescriptions()){ if(listenerDescription.getListener().getProtocol().toLowerCase().equals("http")){ return listenerDescription; } } throw new BootstrapException("Unable to find any listeners which supports http on ELB " + loadBalancer.getLoadBalancerName()); }
if (getCanonicalHostedZoneNameID() != null) sb.append("CanonicalHostedZoneNameID: ").append(getCanonicalHostedZoneNameID()).append(","); if (getListenerDescriptions() != null) sb.append("ListenerDescriptions: ").append(getListenerDescriptions()).append(","); if (getPolicies() != null) sb.append("Policies: ").append(getPolicies()).append(",");
public LoadBalancerAttributes getLoadBalancerAttributes(LoadBalancerDescription sourceLoadBalancer, AmazonElasticLoadBalancing sourceClient) { LoadBalancerAttributes sourceAttributes = sourceClient.describeLoadBalancerAttributes( new DescribeLoadBalancerAttributesRequest().withLoadBalancerName(sourceLoadBalancer.getLoadBalancerName())).getLoadBalancerAttributes(); if (sourceLoadBalancer.getListenerDescriptions().stream().anyMatch(l -> l.getListener().getInstancePort() == 0)) { sourceAttributes.setCrossZoneLoadBalancing(new CrossZoneLoadBalancing().withEnabled(true)); } return sourceAttributes; }
request.addParameter(prefix, StringUtils.fromString(canonicalHostedZoneNameID)); if (_loadBalancerDescription.getListenerDescriptions() != null) { prefix = _prefix + "ListenerDescriptions"; java.util.List<ListenerDescription> listenerDescriptions = _loadBalancerDescription .getListenerDescriptions(); int listenerDescriptionsIndex = 1; String listenerDescriptionsPrefix = prefix;
private void addPublicIngress(AmazonEC2 targetAmazonEC2, String elbGroupId, LoadBalancerDescription sourceDescription) { List<IpPermission> permissions = sourceDescription.getListenerDescriptions().stream().map(l -> new IpPermission() .withIpProtocol("tcp") .withFromPort(l.getListener().getLoadBalancerPort()) .withToPort(l.getListener().getLoadBalancerPort()) .withIpv4Ranges(new IpRange().withCidrIp("0.0.0.0/0")) //TODO(cfieber)-ipv6 ).collect(Collectors.toList()); targetAmazonEC2.authorizeSecurityGroupIngress(new AuthorizeSecurityGroupIngressRequest() .withGroupId(elbGroupId) .withIpPermissions(permissions) ); }
@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; }
Set<String> policiesToRetrieve = new HashSet<>(); Map<String, String> policyNameMap = new HashMap<>(); source.getListenerDescriptions().forEach(d -> policiesToRetrieve.addAll(d.getPolicyNames())); List<PolicyDescription> sourcePolicies = sourceClient.describeLoadBalancerPolicies( new DescribeLoadBalancerPoliciesRequest() source.getListenerDescriptions().forEach(l -> targetClient.setLoadBalancerPoliciesOfListener( new SetLoadBalancerPoliciesOfListenerRequest() .withLoadBalancerName(loadBalancerName)
.anyMatch(p -> p.getUserIdGroupPairs().stream().anyMatch(u -> u.getGroupId().equals(elbGroupId))); if (!hasElbIngressPermission) { sourceDescription.getListenerDescriptions().forEach(l -> { Listener listener = l.getListener(); IpPermission newPermission = new IpPermission().withIpProtocol("tcp")
if (other.getCanonicalHostedZoneNameID() != null && other.getCanonicalHostedZoneNameID().equals(this.getCanonicalHostedZoneNameID()) == false) return false; if (other.getListenerDescriptions() == null ^ this.getListenerDescriptions() == null) return false; if (other.getListenerDescriptions() != null && other.getListenerDescriptions().equals(this.getListenerDescriptions()) == false) return false; if (other.getPolicies() == null ^ this.getPolicies() == null)