2 * Copyright (C) 2013 Red Hat, Inc.
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 * Authors : Madhu Venugopal, Brent Salisbury
10 package org.opendaylight.ovsdb.neutron;
12 import org.opendaylight.controller.sal.core.Node;
13 import org.opendaylight.ovsdb.lib.table.internal.Table;
15 public class SouthboundEvent {
16 public enum Type { NODE, ROW };
17 public enum Action { ADD, UPDATE, DELETE };
19 private Action action;
21 private String tableName;
24 public SouthboundEvent(Node node, Action action) {
26 this.type = Type.NODE;
30 public SouthboundEvent(Node node, String tableName, String uuid, Table<?> row, Action action) {
35 this.tableName = tableName;
39 public Type getType() {
42 public Action getAction() {
45 public Node getNode() {
48 public String getTableName() {
51 public String getUuid() {
54 public Table<?> getRow() {
58 public String toString() {
59 return "SouthboundEvent [type=" + type + ", action=" + action + ", node=" + node + ", tableName=" + tableName
60 + ", uuid=" + uuid + ", row=" + row + "]";
63 public int hashCode() {
66 result = prime * result + ((action == null) ? 0 : action.hashCode());
67 result = prime * result + ((node == null) ? 0 : node.hashCode());
68 result = prime * result + ((tableName == null) ? 0 : tableName.hashCode());
69 result = prime * result + ((type == null) ? 0 : type.hashCode());
70 result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
74 public boolean equals(Object obj) {
79 if (getClass() != obj.getClass())
81 SouthboundEvent other = (SouthboundEvent) obj;
82 if (action != other.action)
85 if (other.node != null)
87 } else if (!node.equals(other.node))
89 if (tableName == null) {
90 if (other.tableName != null)
92 } else if (!tableName.equals(other.tableName))
94 if (type != other.type)
97 if (other.uuid != null)
99 } else if (!uuid.equals(other.uuid))