X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-eos%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fentityownership%2FDistributedEntityOwnershipCandidateRegistration.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-eos%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fentityownership%2FDistributedEntityOwnershipCandidateRegistration.java;h=4888f6ed7696ed72eca67bc7b454d59f98e71855;hb=f9ee2cce797cf12402dd55c406f3e270d7d2e20d;hp=0000000000000000000000000000000000000000;hpb=44d274e8a4282ef859a35369c563e4963cf2185a;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipCandidateRegistration.java b/opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipCandidateRegistration.java new file mode 100644 index 0000000000..4888f6ed76 --- /dev/null +++ b/opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipCandidateRegistration.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.cluster.entityownership; + +import org.opendaylight.mdsal.eos.dom.api.DOMEntity; +import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipCandidateRegistration; +import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; + +/** + * Implementation of EntityOwnershipCandidateRegistration. + * + * @author Thomas Pantelis + */ +class DistributedEntityOwnershipCandidateRegistration extends AbstractObjectRegistration + implements DOMEntityOwnershipCandidateRegistration { + private final DistributedEntityOwnershipService service; + + DistributedEntityOwnershipCandidateRegistration(final DOMEntity entity, + final DistributedEntityOwnershipService service) { + super(entity); + this.service = service; + } + + @Override + protected void removeRegistration() { + service.unregisterCandidate(getInstance()); + } +}