X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fentityownership%2FDistributedEntityOwnershipListenerRegistration.java;h=2e0f4b4f2d9b748e5e784736e52d28d264e7df8c;hb=5bbe45d0b189e706ed587e5e4a30c1205213c2f7;hp=9498e8fccf6a14df0fd8ce8cdba4aca927f4b0d4;hpb=4f2d31367df3b74d326d4a7c69bd20789d020198;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipListenerRegistration.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipListenerRegistration.java index 9498e8fccf..2e0f4b4f2d 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipListenerRegistration.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipListenerRegistration.java @@ -7,22 +7,26 @@ */ package org.opendaylight.controller.cluster.datastore.entityownership; -import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener; -import org.opendaylight.controller.md.sal.common.impl.clustering.AbstractEntityOwnershipListenerRegistration; +import com.google.common.base.Preconditions; +import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipListener; +import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipListenerRegistration; +import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; /** * Implementation of EntityOwnershipListenerRegistration. * * @author Thomas Pantelis */ -class DistributedEntityOwnershipListenerRegistration extends AbstractEntityOwnershipListenerRegistration { - +class DistributedEntityOwnershipListenerRegistration extends AbstractObjectRegistration + implements DOMEntityOwnershipListenerRegistration { private final DistributedEntityOwnershipService service; + private final String entityType; - DistributedEntityOwnershipListenerRegistration(EntityOwnershipListener listener, String entityType, + DistributedEntityOwnershipListenerRegistration(DOMEntityOwnershipListener listener, String entityType, DistributedEntityOwnershipService service) { - super(listener, entityType); - this.service = service; + super(listener); + this.entityType = Preconditions.checkNotNull(entityType, "entityType cannot be null"); + this.service = Preconditions.checkNotNull(service, "DOMEntityOwnershipListener cannot be null"); } @Override @@ -30,6 +34,11 @@ class DistributedEntityOwnershipListenerRegistration extends AbstractEntityOwner service.unregisterListener(getEntityType(), getInstance()); } + @Override + public String getEntityType() { + return entityType; + } + @Override public String toString() { return "DistributedEntityOwnershipListenerRegistration [entityType=" + getEntityType()