2 * Copyright (C) 2014 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 : Dave Tucker, Flavio Fernandes
11 package org.opendaylight.ovsdb.openstack.netvirt;
13 import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP;
14 import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
15 import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
16 import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
17 import org.opendaylight.controller.networkconfig.neutron.NeutronRouter_Interface;
18 import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
20 public class NorthboundEvent extends AbstractEvent {
22 private NeutronPort port;
23 private NeutronSubnet subnet;
24 private NeutronRouter router;
25 private NeutronRouter_Interface routerInterface;
26 private NeutronFloatingIP neutronFloatingIP;
27 private NeutronNetwork neutronNetwork;
29 NorthboundEvent(NeutronPort port, Action action) {
30 super(HandlerType.NEUTRON_PORT, action);
34 NorthboundEvent(NeutronSubnet subnet, Action action) {
35 super(HandlerType.NEUTRON_SUBNET, action);
39 NorthboundEvent(NeutronRouter router, Action action) {
40 super(HandlerType.NEUTRON_ROUTER, action);
44 NorthboundEvent(NeutronRouter router, NeutronRouter_Interface routerInterface, Action action) {
45 super(HandlerType.NEUTRON_ROUTER, action);
47 this.routerInterface = routerInterface;
50 NorthboundEvent(NeutronFloatingIP neutronFloatingIP, Action action) {
51 super(HandlerType.NEUTRON_FLOATING_IP, action);
52 this.neutronFloatingIP = neutronFloatingIP;
55 NorthboundEvent(NeutronNetwork neutronNetwork, Action action) {
56 super(HandlerType.NEUTRON_NETWORK, action);
57 this.neutronNetwork = neutronNetwork;
60 public NeutronPort getPort() {
63 public NeutronSubnet getSubnet() {
66 public NeutronRouter getRouter() {
69 public NeutronRouter_Interface getRouterInterface() {
70 return routerInterface;
72 public NeutronFloatingIP getNeutronFloatingIP() {
73 return neutronFloatingIP;
75 public NeutronNetwork getNeutronNetwork() {
76 return neutronNetwork;
80 public String toString() {
81 return "NorthboundEvent [action=" + super.getAction()
83 + ", subnet=" + subnet
84 + ", router=" + router
85 + ", routerInterface=" + routerInterface
86 + ", floatingIP=" + neutronFloatingIP
87 + ", network=" + neutronNetwork
92 public int hashCode() {
94 int result = super.hashCode();
95 result = prime * result + ((port == null) ? 0 : port.hashCode());
96 result = prime * result + ((subnet == null) ? 0 : subnet.hashCode());
97 result = prime * result + ((router == null) ? 0 : router.hashCode());
98 result = prime * result + ((routerInterface == null) ? 0 : routerInterface.hashCode());
99 result = prime * result + ((neutronFloatingIP == null) ? 0 : neutronFloatingIP.hashCode());
100 result = prime * result + ((neutronNetwork == null) ? 0 : neutronNetwork.hashCode());
105 public boolean equals(Object obj) {
110 if (getClass() != obj.getClass())
112 if (!super.equals(obj))
114 NorthboundEvent other = (NorthboundEvent) obj;
116 if (other.port != null)
118 } else if (!port.equals(other.port))
120 if (subnet == null) {
121 if (other.subnet != null)
123 } else if (!subnet.equals(other.subnet))
125 if (router == null) {
126 if (other.router != null)
128 } else if (!router.equals(other.router))
130 if (routerInterface == null) {
131 if (other.routerInterface != null)
133 } else if (!routerInterface.equals(other.routerInterface))
135 if (neutronFloatingIP == null) {
136 if (other.neutronFloatingIP != null)
138 } else if (!neutronFloatingIP.equals(other.neutronFloatingIP))
140 if (neutronNetwork == null) {
141 if (other.neutronNetwork != null)
143 } else if (!neutronNetwork.equals(other.neutronNetwork))