2 * Copyright (c) 2014, 2015 Red Hat, 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
9 package org.opendaylight.ovsdb.openstack.netvirt;
11 import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
14 * Abstract class for events used by neutron northbound and southbound events.
16 public abstract class AbstractEvent {
18 public enum HandlerType {
23 NEUTRON_PORT_SECURITY,
27 NEUTRON_LOAD_BALANCER,
28 NEUTRON_LOAD_BALANCER_POOL,
29 NEUTRON_LOAD_BALANCER_POOL_MEMBER,
32 public static final int size = HandlerType.values().length;
35 private HandlerType handlerType;
36 private Action action;
38 private AbstractEvent() {
39 // this is private to force proper construction
42 protected AbstractEvent(HandlerType handlerType, Action action) {
43 this.handlerType = handlerType;
47 public HandlerType getHandlerType() {
51 public Action getAction() {
56 public String toString() {
57 return "AbstractEvent [handlerType=" + handlerType + " action=" + action + "]";
61 public int hashCode() {
64 result = prime * result + ((handlerType == null) ? 0 : handlerType.hashCode());
65 result = prime * result + ((action == null) ? 0 : action.hashCode());
70 public boolean equals(Object obj) {
77 if (getClass() != obj.getClass()) {
80 AbstractEvent other = (AbstractEvent) obj;
81 if (handlerType == null) {
82 if (other.handlerType != null) {
85 } else if (!handlerType.equals(other.handlerType)) {
89 if (other.action != null) {
92 } else if (!action.equals(other.action)) {