if (getSourceSecurityGroup() != null) sb.append("SourceSecurityGroup: ").append(getSourceSecurityGroup()).append(","); if (getSecurityGroups() != null) sb.append("SecurityGroups: ").append(getSecurityGroups()).append(","); if (getCreatedTime() != null) sb.append("CreatedTime: ").append(getCreatedTime()).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.getSourceSecurityGroup() != null && other.getSourceSecurityGroup().equals(this.getSourceSecurityGroup()) == 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.getCreatedTime() == null ^ this.getCreatedTime() == null)
/** * <p> * The security groups for the load balancer. Valid only for load balancers * in a VPC. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param securityGroups <p> * The security groups for the load balancer. Valid only for load * balancers in a VPC. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public LoadBalancerDescription 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; }
if (getSourceSecurityGroup() != null) sb.append("SourceSecurityGroup: " + getSourceSecurityGroup() + ","); if (getSecurityGroups() != null) sb.append("SecurityGroups: " + getSecurityGroups() + ","); if (getCreatedTime() != null) sb.append("CreatedTime: " + getCreatedTime() + ",");
+ ((getSourceSecurityGroup() == null) ? 0 : getSourceSecurityGroup().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
&& other.getSourceSecurityGroup().equals(this.getSourceSecurityGroup()) == 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.getCreatedTime() == null ^ this.getCreatedTime() == null)
protected void mapElbToSecurityGroups(LoadBalancerDescription lb, String elbArn, String region) { LinkageHelper linkage = newLinkageHelper().withFromArn(elbArn).withTargetLabel("AwsSecurityGroup") .withLinkLabel("ATTACHED_TO").withTargetValues(lb.getSecurityGroups().stream() .map(sg -> createArn("ec2", "security-group", sg)).collect(Collectors.toList())); linkage.execute(); }
/** * Generates a list of security groups that should be applied to the target load balancer * * @param sourceDescription AWS descriptor of source load balancer * @param result result object of the calling migate operation * @return the list of security groups that will be created or added, excluding the elb-specific security group */ protected List<MigrateSecurityGroupResult> getTargetSecurityGroups(LoadBalancerDescription sourceDescription, MigrateLoadBalancerResult result) { sourceDescription.getSecurityGroups().stream() .filter(g -> !sourceLookup.getSecurityGroupById(source.getCredentialAccount(), g, source.getVpcId()).isPresent()) .forEach(m -> result.getWarnings().add("Skipping creation of security group: " + m + " (could not be found in source location)")); List<SecurityGroup> currentGroups = sourceDescription.getSecurityGroups().stream() .filter(g -> sourceLookup.getSecurityGroupById(source.getCredentialAccount(), g, source.getVpcId()).isPresent()) .map(g -> sourceLookup.getSecurityGroupById(source.getCredentialAccount(), g, source.getVpcId()) .get().getSecurityGroup()).collect(Collectors.toList()); return sourceDescription.getSecurityGroups().stream() .filter(g -> currentGroups.stream().anyMatch(g2 -> g2.getGroupId().equals(g))) .map(g -> { SecurityGroup match = currentGroups.stream().filter(g3 -> g3.getGroupId().equals(g)).findFirst().get(); SecurityGroupLocation sourceLocation = new SecurityGroupLocation(); sourceLocation.setName(match.getGroupName()); sourceLocation.setRegion(source.getRegion()); sourceLocation.setCredentials(source.getCredentials()); sourceLocation.setVpcId(source.getVpcId()); return new SecurityGroupMigrator(sourceLookup, targetLookup, migrateSecurityGroupStrategy, sourceLocation, new SecurityGroupLocation(target)).migrate(dryRun); }) .collect(Collectors.toList()); }
if (getSourceSecurityGroup() != null) sb.append("SourceSecurityGroup: ").append(getSourceSecurityGroup()).append(","); if (getSecurityGroups() != null) sb.append("SecurityGroups: ").append(getSecurityGroups()).append(","); if (getCreatedTime() != null) sb.append("CreatedTime: ").append(getCreatedTime()).append(",");
elb.getSecurityGroups(), account, awsRegion);
prefix + "."); if (_loadBalancerDescription.getSecurityGroups() != null) { prefix = _prefix + "SecurityGroups"; java.util.List<String> securityGroups = _loadBalancerDescription.getSecurityGroups(); int securityGroupsIndex = 1; String securityGroupsPrefix = 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.getSourceSecurityGroup() != null && other.getSourceSecurityGroup().equals(this.getSourceSecurityGroup()) == 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.getCreatedTime() == null ^ this.getCreatedTime() == null)