384996b8e30dbc1de14f99685e3601e7d421910b
[mdsal.git] / entityownership / mdsal-eos-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / clustering / EntityOwnershipService.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.binding.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.binding.InstanceIdentifier;
17
18 /**
19  * Binding version of {@link GenericEntityOwnershipService}.
20  *
21  * @author Thomas Pantelis
22  */
23 @Beta
24 public interface EntityOwnershipService extends
25         GenericEntityOwnershipService<InstanceIdentifier<?>, Entity, EntityOwnershipListener> {
26
27     /**
28      * {@inheritDoc}
29      */
30     @Override
31     EntityOwnershipCandidateRegistration registerCandidate(@Nonnull Entity entity)
32             throws CandidateAlreadyRegisteredException;
33
34     /**
35      * {@inheritDoc}
36      */
37     @Override
38     EntityOwnershipListenerRegistration registerListener(@Nonnull String entityType,
39             @Nonnull EntityOwnershipListener listener);
40
41     /**
42      * {@inheritDoc}
43      */
44     @Override
45     Optional<EntityOwnershipState> getOwnershipState(@Nonnull Entity forEntity);
46
47     /**
48      * {@inheritDoc}
49      */
50     @Override
51     boolean isCandidateRegistered(@Nonnull Entity forEntity);
52 }