Bug 4105: Implement UnregisterCandidateLocal in EntityOwnershipShard
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / messages / UnregisterCandidateLocal.java
index d99ec7b154ec7dab341e08428a70a8579a429f34..04d7960b7faafe5bc715c440a42eae9aaa5c2778 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.cluster.datastore.entityownership.messages;
 
 import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidate;
 
 /**
  * Message sent to the local EntityOwnershipShard to unregister a candidate.
@@ -15,20 +16,24 @@ import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
  * @author Thomas Pantelis
  */
 public class UnregisterCandidateLocal {
+    private final EntityOwnershipCandidate candidate;
     private final Entity entity;
 
-    public UnregisterCandidateLocal(Entity entity) {
+    public UnregisterCandidateLocal(EntityOwnershipCandidate candidate, Entity entity) {
+        this.candidate = candidate;
         this.entity = entity;
     }
 
+    public EntityOwnershipCandidate getCandidate() {
+        return candidate;
+    }
+
     public Entity getEntity() {
         return entity;
     }
 
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
-        builder.append("UnregisterCandidateLocal [entity=").append(entity).append("]");
-        return builder.toString();
+        return "UnregisterCandidateLocal [entity=" + entity + ", candidate=" + candidate + "]";
     }
 }