@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyId() == null) ? 0 : getPolicyId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); hashCode = prime * hashCode + ((getDefaultVersionId() == null) ? 0 : getDefaultVersionId().hashCode()); hashCode = prime * hashCode + ((getAttachmentCount() == null) ? 0 : getAttachmentCount().hashCode()); hashCode = prime * hashCode + ((getPermissionsBoundaryUsageCount() == null) ? 0 : getPermissionsBoundaryUsageCount().hashCode()); hashCode = prime * hashCode + ((getIsAttachable() == null) ? 0 : getIsAttachable().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); hashCode = prime * hashCode + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode()); return hashCode; }
if (other.getPolicyId() != null && other.getPolicyId().equals(this.getPolicyId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getPath() == null ^ this.getPath() == null)
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyId() == null) ? 0 : getPolicyId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); hashCode = prime * hashCode + ((getDefaultVersionId() == null) ? 0 : getDefaultVersionId().hashCode()); hashCode = prime * hashCode + ((getAttachmentCount() == null) ? 0 : getAttachmentCount().hashCode()); hashCode = prime * hashCode + ((getPermissionsBoundaryUsageCount() == null) ? 0 : getPermissionsBoundaryUsageCount().hashCode()); hashCode = prime * hashCode + ((getIsAttachable() == null) ? 0 : getIsAttachable().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); hashCode = prime * hashCode + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode()); return hashCode; }
private void updateAttachedEntities(AmazonIdentityManagementClient iam, Policy policy) { ListEntitiesForPolicyRequest request = new ListEntitiesForPolicyRequest() .withPolicyArn(policy.getArn()); List<String> attachedRoles = new ArrayList<>(); List<String> attachedUsers = new ArrayList<>(); while (true) { ListEntitiesForPolicyResult attachedEntities = iam.listEntitiesForPolicy(request); attachedRoles.addAll(attachedEntities.getPolicyRoles().stream() .map(rp -> createIamArn("role", rp.getRoleName())).collect(Collectors.toList())); attachedUsers.addAll(attachedEntities.getPolicyUsers().stream() .map(ur -> createIamArn("user", ur.getUserName())).collect(Collectors.toList())); // TODO - group if (!attachedEntities.isTruncated()) { break; } request.setMarker(attachedEntities.getMarker()); } if (!attachedRoles.isEmpty()) { newLinkageHelper().withLinkLabel("ATTACHED_TO").withFromArn(policy.getArn()) .withTargetLabel("AwsIamRole").withTargetValues(attachedRoles).execute(); } if (!attachedUsers.isEmpty()) { newLinkageHelper().withLinkLabel("ATTACHED_TO").withFromArn(policy.getArn()) .withTargetLabel("AwsIamUser").withTargetValues(attachedUsers).execute(); } }
if ((awsManagedPolicy = policy.getArn().startsWith("arn:aws:iam::aws:policy")) && policy.getAttachmentCount() != null && policy.getAttachmentCount() == 0) { neo4j.execCypher(cypher, "a", policy.getArn(), "p", n).forEach(gc.MERGE_ACTION::accept); incrementEntityCount(); linkToAccount(policy.getArn());
if (other.getPolicyId() != null && other.getPolicyId().equals(this.getPolicyId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getPath() == null ^ this.getPath() == null)
.withPolicyName(policyName)); log_.debug("Created policy " + result.getPolicy().getArn());