Bug 4105: Implement candidate registration close
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / DistributedEntityOwnershipCandidateRegistration.java
index 1089ec28039f8ff0be20fb558999115e86b358a0..70c454e3afbbc79c90b67669b5025f45a1e3009a 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());
     }
 }