Skip to content

Commit

Permalink
Added todo's such that, after FE release, will be able to add back th…
Browse files Browse the repository at this point in the history
…e logic such that policies,stakeholder, stakeholderTitle will write new wildcard pattern.
  • Loading branch information
hr2904 committed Jun 27, 2024
1 parent 7cb2997 commit 5989e68
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ private void processCreatePolicy(AtlasStruct entity) throws AtlasBaseException {
if (!POLICY_SUB_CATEGORY_DOMAIN.equals(policySubCategory)) {
validator.validate(policy, null, parentEntity, CREATE);
validateConnectionAdmin(policy);
} else {
validateAndReduce(policy);
}
// TODO : uncomment after FE release
// else {
// validateAndReduce(policy);
// }

policy.setAttribute(QUALIFIED_NAME, String.format("%s/%s", getEntityQualifiedName(parentEntity), getUUID()));

Expand Down Expand Up @@ -197,9 +199,11 @@ private void processUpdatePolicy(AtlasStruct entity, AtlasVertex vertex) throws
if (!POLICY_SUB_CATEGORY_DOMAIN.equals(policySubCategory)) {
validator.validate(policy, existingPolicy, parentEntity, UPDATE);
validateConnectionAdmin(policy);
} else {
validateAndReduce(policy);
}
// TODO : uncomment after FE release
// else {
// validateAndReduce(policy);
// }

String qName = getEntityQualifiedName(existingPolicy);
policy.setAttribute(QUALIFIED_NAME, qName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ private void processCreateStakeholderTitle(AtlasEntity entity) throws AtlasBaseE
if (domainQualifiedNames.size() > 1) {

domainQualifiedNames.clear();
domainQualifiedNames.add(NEW_STAR);
// TODO : convert this to NEW_STAR after FE release
domainQualifiedNames.add(STAR);
entity.setAttribute(ATTR_DOMAIN_QUALIFIED_NAMES, domainQualifiedNames);
} else {
domainQualifiedNames.replaceAll(s -> s.equals(STAR) ? NEW_STAR : s);
}
} // TODO : uncomment this after FE release
// else {
// domainQualifiedNames.replaceAll(s -> s.equals(STAR) ? NEW_STAR : s);
// }

String qualifiedName = format(PATTERN_QUALIFIED_NAME_ALL_DOMAINS, getUUID());
entity.setAttribute(QUALIFIED_NAME, qualifiedName);
Expand Down Expand Up @@ -214,7 +216,8 @@ private void authorizeDomainAccess(List<String> domainQualifiedNames) throws Atl
String domainQualifiedNameToAuth;

if (domainQualifiedNames.contains(STAR) || domainQualifiedNames.contains(NEW_STAR)) {
domainQualifiedNameToAuth = NEW_STAR;
//TODO : Convert this to NEW_STAR
domainQualifiedNameToAuth = STAR;
} else {
domainQualifiedNameToAuth = domainQualifiedName;
}
Expand Down

0 comments on commit 5989e68

Please sign in to comment.