Bug 4105: Add dynamic module/shard config for entity-owners shard
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / DistributedEntityOwnershipCandidateRegistration.java
index 1089ec28039f8ff0be20fb558999115e86b358a0..94c7aa09766c4382f2085fbd0b1dae06b39daff4 100644 (file)
@@ -17,13 +17,16 @@ import org.opendaylight.controller.md.sal.common.impl.clustering.AbstractEntityO
  * @author Thomas Pantelis
  */
 class DistributedEntityOwnershipCandidateRegistration extends AbstractEntityOwnershipCandidateRegistration {
+    private final DistributedEntityOwnershipService service;
 
-    DistributedEntityOwnershipCandidateRegistration(EntityOwnershipCandidate candidate, Entity entity) {
+    DistributedEntityOwnershipCandidateRegistration(EntityOwnershipCandidate candidate, Entity entity,
+            DistributedEntityOwnershipService service) {
         super(candidate, entity);
+        this.service = service;
     }
 
     @Override
     public void close() {
-        // TODO - need to send unregister message.
+        service.unregisterCandidate(getEntity(), getInstance());
     }
 }