Repository: atlas
Updated Branches:
  refs/heads/master 0cde9f921 -> 0dcd68906


ATLAS-2551: Update AtlasRelatedObjectId to include relationship status

Change-Id: If1158a70b894e10d9b7205ba536aa6e8a928faa6


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/0dcd6890
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/0dcd6890
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/0dcd6890

Branch: refs/heads/master
Commit: 0dcd68906fcdfc9d55069d37800353c497faed7e
Parents: 0cde9f9
Author: apoorvnaik <apoorvn...@apache.org>
Authored: Mon Apr 9 15:33:17 2018 -0700
Committer: apoorvnaik <apoorvn...@apache.org>
Committed: Mon Apr 9 15:39:32 2018 -0700

----------------------------------------------------------------------
 .../model/instance/AtlasRelatedObjectId.java    | 27 +++++++++++++++-----
 .../store/graph/v1/EntityGraphRetriever.java    |  3 ++-
 2 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/0dcd6890/intg/src/main/java/org/apache/atlas/model/instance/AtlasRelatedObjectId.java
----------------------------------------------------------------------
diff --git 
a/intg/src/main/java/org/apache/atlas/model/instance/AtlasRelatedObjectId.java 
b/intg/src/main/java/org/apache/atlas/model/instance/AtlasRelatedObjectId.java
index cca7044..543de61 100644
--- 
a/intg/src/main/java/org/apache/atlas/model/instance/AtlasRelatedObjectId.java
+++ 
b/intg/src/main/java/org/apache/atlas/model/instance/AtlasRelatedObjectId.java
@@ -46,24 +46,29 @@ public class AtlasRelatedObjectId extends AtlasObjectId 
implements Serializable
     public static final String KEY_RELATIONSHIP_GUID       = 
"relationshipGuid";
     public static final String KEY_RELATIONSHIP_ATTRIBUTES = 
"relationshipAttributes";
 
-    private String      displayText             = null;
-    private String      relationshipGuid        = null;
-    private AtlasStruct relationshipAttributes;
+    private String                   displayText        = null;
+    private String                   relationshipGuid   = null;
+    private AtlasRelationship.Status relationshipStatus = null;
+    private AtlasStruct              relationshipAttributes;
 
     public AtlasRelatedObjectId() { }
 
-    public AtlasRelatedObjectId(String guid, String typeName, String 
relationshipGuid, AtlasStruct relationshipAttributes) {
+    public AtlasRelatedObjectId(String guid, String typeName, String 
relationshipGuid,
+                                AtlasRelationship.Status relationshipStatus, 
AtlasStruct relationshipAttributes) {
         super(guid, typeName);
 
         setRelationshipGuid(relationshipGuid);
+        setRelationshipStatus(relationshipStatus);
         setRelationshipAttributes(relationshipAttributes);
     }
 
     public AtlasRelatedObjectId(String guid, String typeName, Map<String, 
Object> uniqueAttributes, String displayText,
-                                String relationshipGuid, AtlasStruct 
relationshipAttributes) {
+                                String relationshipGuid, 
AtlasRelationship.Status relationshipStatus,
+                                AtlasStruct relationshipAttributes) {
         super(guid, typeName, uniqueAttributes);
 
         setRelationshipGuid(relationshipGuid);
+        setRelationshipStatus(relationshipStatus);
         setDisplayText(displayText);
         setRelationshipAttributes(relationshipAttributes);
     }
@@ -88,12 +93,13 @@ public class AtlasRelatedObjectId extends AtlasObjectId 
implements Serializable
         AtlasRelatedObjectId that = (AtlasRelatedObjectId) o;
         return Objects.equals(displayText, that.displayText) &&
                Objects.equals(relationshipGuid, that.relationshipGuid) &&
+               Objects.equals(relationshipStatus, that.relationshipStatus) &&
                Objects.equals(relationshipAttributes, 
that.relationshipAttributes);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(super.hashCode(), displayText, relationshipGuid, 
relationshipAttributes);
+        return Objects.hash(super.hashCode(), displayText, relationshipGuid, 
relationshipStatus, relationshipAttributes);
     }
 
     @Override
@@ -111,9 +117,18 @@ public class AtlasRelatedObjectId extends AtlasObjectId 
implements Serializable
         super.toString(sb);
         sb.append("displayText='").append(displayText).append('\'');
         sb.append(", 
relationshipGuid='").append(relationshipGuid).append('\'');
+        sb.append(", 
relationshipStatus='").append(relationshipStatus).append('\'');
         sb.append(", relationshipAttributes=").append(relationshipAttributes);
         sb.append('}');
 
         return sb;
     }
+
+    public AtlasRelationship.Status getRelationshipStatus() {
+        return relationshipStatus;
+    }
+
+    public void setRelationshipStatus(final AtlasRelationship.Status 
relationshipStatus) {
+        this.relationshipStatus = relationshipStatus;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/0dcd6890/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
index 59513f5..31f6d82 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
@@ -848,7 +848,8 @@ public final class EntityGraphRetriever {
                 String            entityGuid     = getGuid(referenceVertex);
                 AtlasRelationship relationship   = 
mapEdgeToAtlasRelationship(edge);
 
-                ret = new AtlasRelatedObjectId(entityGuid, entityTypeName, 
relationship.getGuid(),
+                ret = new AtlasRelatedObjectId(entityGuid, entityTypeName,
+                                               relationship.getGuid(), 
relationship.getStatus(),
                                                new 
AtlasStruct(relationship.getTypeName(), relationship.getAttributes()));
 
                 Object displayText = getDisplayText(referenceVertex, 
entityTypeName);

Reply via email to