2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. 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.genius.utils.hwvtep;
10 import java.io.PrintStream;
11 import java.util.Objects;
13 public abstract class NodeEvent extends DebugEvent {
15 protected final String nodeId;
17 public NodeEvent(String nodeId) {
21 public String getNodeId() {
26 public boolean equals(Object other) {
30 if (other instanceof NodeEvent) {
31 return Objects.equals(nodeId, ((NodeEvent) other).nodeId);
37 public int hashCode() {
38 return nodeId != null ? nodeId.hashCode() : 0;
42 Connected,Disconnected
45 public static class NodeConnectedEvent extends NodeEvent {
47 public NodeConnectedEvent(String nodeId) {
51 public void print(PrintStream out) {
53 out.print(" connected");
57 public static class NodeDisconnectedEvent extends NodeEvent {
59 public NodeDisconnectedEvent(String nodeId) {
63 public void print(PrintStream out) {
65 out.print(" disconnected");
69 public static class ChildAddedEvent extends NodeEvent {
71 public ChildAddedEvent(String nodeId) {
75 public void print(PrintStream out) {
77 out.print(" became HA child");