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.cluster.datastore.entityownership.messages;
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
14 * Message encapsulating an entity ownership change.
16 * @author Thomas Pantelis
18 public class EntityOwnershipChanged {
19 private final Entity entity;
20 private final boolean wasOwner;
21 private final boolean isOwner;
23 public EntityOwnershipChanged(Entity entity, boolean wasOwner, boolean isOwner) {
24 this.entity = Preconditions.checkNotNull(entity, "entity can't be null");
25 this.wasOwner = wasOwner;
26 this.isOwner = isOwner;
29 public Entity getEntity() {
33 public boolean wasOwner() {
37 public boolean isOwner() {
42 public String toString() {
43 return "EntityOwnershipChanged [entity=" + entity + ", wasOwner=" + wasOwner + ", isOwner=" + isOwner + "]";