Inject MD_SAL services directly in sal-binding-it tests
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / clustering / EntityOwnershipState.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.controller.md.sal.common.api.clustering;
9
10 /**
11  * A DTO that encapsulates ownership state for an entity.
12  *
13  * @author Thomas Pantelis
14  *
15  * @deprecated Use org.opendaylight.mdsal.common.api.clustering.EntityOwnershipState instead
16  */
17 @Deprecated
18 public class EntityOwnershipState {
19     private final boolean isOwner;
20     private final boolean hasOwner;
21
22     public EntityOwnershipState(boolean isOwner, boolean hasOwner) {
23         this.isOwner = isOwner;
24         this.hasOwner = hasOwner;
25     }
26
27     /**
28      * Returns the current ownership status of the entity for this process instance.
29      * @return true if this process is the owner of the entity
30      */
31     public boolean isOwner() {
32         return isOwner;
33     }
34
35     /**
36      * Returns the current ownership status of the entity across all process instances.
37      * @return true if the entity has an owner which may or may not be this process. If false, then
38      *         the entity has no candidates and thus no owner.
39      */
40     public boolean hasOwner() {
41         return hasOwner;
42     }
43
44     @Override
45     public String toString() {
46         return "EntityOwnershipState [isOwner=" + isOwner + ", hasOwner=" + hasOwner + "]";
47     }
48 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.