use of org.apache.atlas.model.glossary.enums.AtlasTermRelationshipStatus in project atlas by apache.
the class AbstractGlossaryDTO method constructRelatedTermId.
protected AtlasRelatedTermHeader constructRelatedTermId(AtlasRelatedObjectId relatedObjectId) {
AtlasRelatedTermHeader ret = new AtlasRelatedTermHeader();
ret.setTermGuid(relatedObjectId.getGuid());
ret.setRelationGuid(relatedObjectId.getRelationshipGuid());
ret.setDisplayText(relatedObjectId.getDisplayText());
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;
}
use of org.apache.atlas.model.glossary.enums.AtlasTermRelationshipStatus in project atlas by apache.
the class AbstractGlossaryDTO method constructTermCategorizationId.
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;
}
Aggregations