7aa8502fc5b0adf8491c92b38c276b85f199a8f8
[mdsal.git] / entityownership / mdsal-eos-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / clustering / DOMEntityOwnershipService.java
1 /*
2  * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.dom.api.clustering;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.base.Optional;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.mdsal.common.api.clustering.CandidateAlreadyRegisteredException;
14 import org.opendaylight.mdsal.common.api.clustering.EntityOwnershipState;
15 import org.opendaylight.mdsal.common.api.clustering.GenericEntityOwnershipService;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
17
18 /**
19  * DOM version of {@link GenericEntityOwnershipService}.
20  *
21  * @author Thomas Pantelis
22  */
23 @Beta
24 public interface DOMEntityOwnershipService extends
25         GenericEntityOwnershipService<YangInstanceIdentifier, DOMEntity, DOMEntityOwnershipListener> {
26
27     /**
28      * {@inheritDoc}
29      */
30     @Override
31     DOMEntityOwnershipCandidateRegistration registerCandidate(@Nonnull DOMEntity entity)
32             throws CandidateAlreadyRegisteredException;
33
34     /**
35      * {@inheritDoc}
36      */
37     @Override
38     DOMEntityOwnershipListenerRegistration registerListener(@Nonnull String entityType,
39             @Nonnull DOMEntityOwnershipListener listener);
40
41     /**
42      * {@inheritDoc}
43      */
44     @Override
45     Optional<EntityOwnershipState> getOwnershipState(@Nonnull DOMEntity forEntity);
46
47     /**
48      * {@inheritDoc}
49      */
50     @Override
51     boolean isCandidateRegistered(@Nonnull DOMEntity forEntity);
52 }