X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fentityownership%2FDistributedEntityOwnershipCandidateRegistration.java;h=0492cbcc72b6c6a3be7bae1bbc995927aa49a189;hp=1089ec28039f8ff0be20fb558999115e86b358a0;hb=207129172cb981630f955170cb67efceba02df85;hpb=9883165b61255af5bfcb060b76b16f69a56b1f82 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipCandidateRegistration.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipCandidateRegistration.java index 1089ec2803..0492cbcc72 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipCandidateRegistration.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipCandidateRegistration.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.cluster.datastore.entityownership; import org.opendaylight.controller.md.sal.common.api.clustering.Entity; -import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidate; import org.opendaylight.controller.md.sal.common.impl.clustering.AbstractEntityOwnershipCandidateRegistration; /** @@ -17,13 +16,22 @@ 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) { - super(candidate, entity); + DistributedEntityOwnershipCandidateRegistration(Entity entity, DistributedEntityOwnershipService service) { + super(entity); + this.service = service; } @Override - public void close() { - // TODO - need to send unregister message. + protected void removeRegistration() { + service.unregisterCandidate(getInstance()); } + + @Override + public String toString() { + return "DistributedEntityOwnershipCandidateRegistration [entity=" + getInstance() + "]"; + } + + }