2 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.md.sal.common.api.clustering;
11 * A DTO that encapsulates ownership state for an entity.
13 * @author Thomas Pantelis
15 public class EntityOwnershipState {
16 private final boolean isOwner;
17 private final boolean hasOwner;
19 public EntityOwnershipState(boolean isOwner, boolean hasOwner) {
20 this.isOwner = isOwner;
21 this.hasOwner = hasOwner;
25 * Returns the current ownership status of the entity for this process instance.
26 * @return true if this process is the owner of the entity
28 public boolean isOwner() {
33 * Returns the current ownership status of the entity across all process instances.
34 * @return true if the entity has an owner which may or may not be this process. If false, then
35 * the entity has no candidates and thus no owner.
37 public boolean hasOwner() {
42 public String toString() {
43 return "EntityOwnershipState [isOwner=" + isOwner + ", hasOwner=" + hasOwner + "]";