2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.eos.akka.registry.listener.type.command;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.base.MoreObjects;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.controller.eos.akka.registry.listener.type.EntityTypeListenerActor;
15 import org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange;
16 import org.opendaylight.mdsal.eos.dom.api.DOMEntity;
19 * Notification sent to {@link EntityTypeListenerActor} when there is an owner change for an Entity of a given type.
22 public final class EntityOwnerChanged extends TypeListenerCommand {
23 private final DOMEntity entity;
24 private final EntityOwnershipStateChange change;
25 private final boolean inJeopardy;
27 public EntityOwnerChanged(final DOMEntity entity, final EntityOwnershipStateChange change,
28 final boolean inJeopardy) {
29 this.entity = requireNonNull(entity);
30 this.change = requireNonNull(change);
31 this.inJeopardy = requireNonNull(inJeopardy);
34 public DOMEntity entity() {
38 public EntityOwnershipStateChange change() {
42 public boolean inJeopardy() {
47 public String toString() {
48 return MoreObjects.toStringHelper(this)
49 .add("entity", entity)
50 .add("change", change)
51 .add("inJeopardy", inJeopardy)