private void updateRelationshipAttributes(AtlasRelationship relationship, AtlasRelatedObjectId relatedObjectId) { AtlasStruct relationshipAttributes = relatedObjectId.getRelationshipAttributes(); if (Objects.nonNull(relationshipAttributes)) { for (Map.Entry<String, Object> attrEntry : relationshipAttributes.getAttributes().entrySet()) { relationship.setAttribute(attrEntry.getKey(), attrEntry.getValue()); } } }
private void updateRelationshipAttributes(AtlasRelationship relationship, AtlasRelatedObjectId relatedObjectId) { AtlasStruct relationshipAttributes = relatedObjectId.getRelationshipAttributes(); if (Objects.nonNull(relationshipAttributes)) { for (Map.Entry<String, Object> attrEntry : relationshipAttributes.getAttributes().entrySet()) { relationship.setAttribute(attrEntry.getKey(), attrEntry.getValue()); } } }
private static Map<String, Object> getRelationshipAttributes(Object val) throws AtlasBaseException { if (val instanceof AtlasRelatedObjectId) { AtlasStruct relationshipStruct = ((AtlasRelatedObjectId) val).getRelationshipAttributes(); return (relationshipStruct != null) ? relationshipStruct.getAttributes() : null; } else if (val instanceof Map) { Object relationshipStruct = ((Map) val).get(KEY_RELATIONSHIP_ATTRIBUTES); if (relationshipStruct instanceof Map) { return AtlasTypeUtil.toStructAttributes(((Map) relationshipStruct)); } } return null; }
private static Map<String, Object> getRelationshipAttributes(Object val) throws AtlasBaseException { if (val instanceof AtlasRelatedObjectId) { AtlasStruct relationshipStruct = ((AtlasRelatedObjectId) val).getRelationshipAttributes(); return (relationshipStruct != null) ? relationshipStruct.getAttributes() : null; } else if (val instanceof Map) { Object relationshipStruct = ((Map) val).get(KEY_RELATIONSHIP_ATTRIBUTES); if (relationshipStruct instanceof Map) { return AtlasTypeUtil.toStructAttributes(((Map) relationshipStruct)); } } return null; }
protected AtlasRelatedCategoryHeader constructRelatedCategoryId(AtlasRelatedObjectId relatedObjectId) { AtlasRelatedCategoryHeader ret = new AtlasRelatedCategoryHeader(); ret.setCategoryGuid(relatedObjectId.getGuid()); ret.setRelationGuid(relatedObjectId.getRelationshipGuid()); AtlasStruct relationshipAttributes = relatedObjectId.getRelationshipAttributes(); if (relationshipAttributes != null) { ret.setDescription((String) relationshipAttributes.getAttribute("description")); } return ret; }
protected AtlasRelatedCategoryHeader constructRelatedCategoryId(AtlasRelatedObjectId relatedObjectId) { AtlasRelatedCategoryHeader ret = new AtlasRelatedCategoryHeader(); ret.setCategoryGuid(relatedObjectId.getGuid()); ret.setRelationGuid(relatedObjectId.getRelationshipGuid()); AtlasStruct relationshipAttributes = relatedObjectId.getRelationshipAttributes(); if (relationshipAttributes != null) { ret.setDescription((String) relationshipAttributes.getAttribute("description")); } return ret; }
protected AtlasTermCategorizationHeader constructTermCategorizationId(final AtlasRelatedObjectId category) { AtlasTermCategorizationHeader ret = new AtlasTermCategorizationHeader(); ret.setCategoryGuid(category.getGuid()); ret.setRelationGuid(category.getRelationshipGuid()); AtlasStruct relationshipAttributes = category.getRelationshipAttributes(); if (relationshipAttributes != null) { ret.setDescription((String) relationshipAttributes.getAttribute("description")); Object status = relationshipAttributes.getAttribute("status"); if (status instanceof AtlasTermRelationshipStatus) { ret.setStatus((AtlasTermRelationshipStatus) status); } else if (status instanceof String) { ret.setStatus(AtlasTermRelationshipStatus.valueOf((String) status)); } } return ret; }
protected AtlasTermCategorizationHeader constructTermCategorizationId(final AtlasRelatedObjectId category) { AtlasTermCategorizationHeader ret = new AtlasTermCategorizationHeader(); ret.setCategoryGuid(category.getGuid()); ret.setRelationGuid(category.getRelationshipGuid()); AtlasStruct relationshipAttributes = category.getRelationshipAttributes(); if (relationshipAttributes != null) { ret.setDescription((String) relationshipAttributes.getAttribute("description")); Object status = relationshipAttributes.getAttribute("status"); if (status instanceof AtlasTermRelationshipStatus) { ret.setStatus((AtlasTermRelationshipStatus) status); } else if (status instanceof String) { ret.setStatus(AtlasTermRelationshipStatus.valueOf((String) status)); } } return ret; }
protected AtlasRelatedTermHeader constructRelatedTermId(AtlasRelatedObjectId relatedObjectId) { AtlasRelatedTermHeader ret = new AtlasRelatedTermHeader(); ret.setTermGuid(relatedObjectId.getGuid()); ret.setRelationGuid(relatedObjectId.getRelationshipGuid()); AtlasStruct relationshipAttributes = relatedObjectId.getRelationshipAttributes(); if (relationshipAttributes != null) { ret.setDescription((String) relationshipAttributes.getAttribute("description")); ret.setExpression((String) relationshipAttributes.getAttribute("expression")); ret.setSource((String) relationshipAttributes.getAttribute("source")); ret.setSteward((String) relationshipAttributes.getAttribute("steward")); Object status = relationshipAttributes.getAttribute("status"); if (status instanceof String) { ret.setStatus(AtlasTermRelationshipStatus.valueOf((String) status)); } else if (status instanceof AtlasTermRelationshipStatus) { ret.setStatus((AtlasTermRelationshipStatus) status); } } return ret; }
protected AtlasRelatedTermHeader constructRelatedTermId(AtlasRelatedObjectId relatedObjectId) { AtlasRelatedTermHeader ret = new AtlasRelatedTermHeader(); ret.setTermGuid(relatedObjectId.getGuid()); ret.setRelationGuid(relatedObjectId.getRelationshipGuid()); AtlasStruct relationshipAttributes = relatedObjectId.getRelationshipAttributes(); if (relationshipAttributes != null) { ret.setDescription((String) relationshipAttributes.getAttribute("description")); ret.setExpression((String) relationshipAttributes.getAttribute("expression")); ret.setSource((String) relationshipAttributes.getAttribute("source")); ret.setSteward((String) relationshipAttributes.getAttribute("steward")); Object status = relationshipAttributes.getAttribute("status"); if (status instanceof String) { ret.setStatus(AtlasTermRelationshipStatus.valueOf((String) status)); } else if (status instanceof AtlasTermRelationshipStatus) { ret.setStatus((AtlasTermRelationshipStatus) status); } } return ret; }