Bug 4105: Choose Owner for an Entity based on first come first served basis
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / EntityOwnersModel.java
index 57950071fc8c565f5364ee54ecffb7574281da3e..46f33585cf126bdf6775a3588b15e65e1b1071a9 100644 (file)
@@ -44,6 +44,15 @@ final class EntityOwnersModel {
 
     }
 
+    static YangInstanceIdentifier candidatePath(String entityType, YangInstanceIdentifier entityId,
+            String candidateName) {
+        return YangInstanceIdentifier.builder(ENTITY_OWNERS_PATH).node(EntityType.QNAME).
+                nodeWithKey(EntityType.QNAME, ENTITY_TYPE_QNAME, entityType).node(ENTITY_QNAME).
+                        nodeWithKey(ENTITY_QNAME, ENTITY_ID_QNAME, entityId).node(Candidate.QNAME).
+                                nodeWithKey(Candidate.QNAME, CANDIDATE_NAME_QNAME, candidateName).build();
+
+    }
+
     static NormalizedNode<?, ?> entityOwnersWithCandidate(String entityType, YangInstanceIdentifier entityId,
             String candidateName) {
         return entityOwnersWithEntityTypeEntry(entityTypeEntryWithEntityEntry(entityType,