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.translator.NeutronFloatingIP;
12 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
13 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
14 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
15 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
16 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
17 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
18 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
19 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
20 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
21 import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
23 public class NorthboundEvent extends AbstractEvent {
25 private NeutronPort port;
26 private NeutronSubnet subnet;
27 private NeutronRouter router;
28 private NeutronRouter_Interface routerInterface;
29 private NeutronFloatingIP neutronFloatingIP;
30 private NeutronNetwork neutronNetwork;
31 private NeutronLoadBalancer loadBalancer;
32 private NeutronLoadBalancerPool loadBalancerPool;
33 private NeutronLoadBalancerPoolMember loadBalancerPoolMember;
34 private NeutronSecurityRule neutronSecurityRule;
36 NorthboundEvent(NeutronPort port, Action action) {
37 super(HandlerType.NEUTRON_PORT, action);
41 NorthboundEvent(NeutronSubnet subnet, Action action) {
42 super(HandlerType.NEUTRON_SUBNET, action);
46 NorthboundEvent(NeutronRouter router, Action action) {
47 super(HandlerType.NEUTRON_ROUTER, action);
51 NorthboundEvent(NeutronRouter router, NeutronRouter_Interface routerInterface, Action action) {
52 super(HandlerType.NEUTRON_ROUTER, action);
54 this.routerInterface = routerInterface;
57 NorthboundEvent(NeutronFloatingIP neutronFloatingIP, Action action) {
58 super(HandlerType.NEUTRON_FLOATING_IP, action);
59 this.neutronFloatingIP = neutronFloatingIP;
62 NorthboundEvent(NeutronNetwork neutronNetwork, Action action) {
63 super(HandlerType.NEUTRON_NETWORK, action);
64 this.neutronNetwork = neutronNetwork;
67 NorthboundEvent(NeutronLoadBalancer loadBalancer, Action action) {
68 super(HandlerType.NEUTRON_LOAD_BALANCER, action);
69 this.loadBalancer = loadBalancer;
72 NorthboundEvent(NeutronLoadBalancerPool loadBalancerPool, Action action) {
73 super(HandlerType.NEUTRON_LOAD_BALANCER_POOL, action);
74 this.loadBalancerPool = loadBalancerPool;
77 NorthboundEvent(NeutronLoadBalancerPoolMember loadBalancerPoolMember, Action action) {
78 super(HandlerType.NEUTRON_LOAD_BALANCER_POOL_MEMBER, action);
79 this.loadBalancerPoolMember = loadBalancerPoolMember;
82 NorthboundEvent(NeutronSecurityRule neutronSecurityRule, Action action) {
83 super(HandlerType.NEUTRON_PORT_SECURITY, action);
84 this.neutronSecurityRule = neutronSecurityRule;
87 public NeutronPort getPort() {
90 public NeutronSubnet getSubnet() {
93 public NeutronRouter getRouter() {
96 public NeutronRouter_Interface getRouterInterface() {
97 return routerInterface;
99 public NeutronFloatingIP getNeutronFloatingIP() {
100 return neutronFloatingIP;
102 public NeutronNetwork getNeutronNetwork() {
103 return neutronNetwork;
105 public NeutronLoadBalancer getLoadBalancer() {
108 public NeutronLoadBalancerPool getLoadBalancerPool() {
109 return loadBalancerPool;
111 public NeutronLoadBalancerPoolMember getLoadBalancerPoolMember() {
112 return loadBalancerPoolMember;
114 public NeutronSecurityRule getNeutronSecurityRule() {
115 return neutronSecurityRule;
119 public String toString() {
120 return "NorthboundEvent [handler=" + super.getHandlerType()
121 + ", action=" + super.getAction()
123 + ", subnet=" + subnet
124 + ", router=" + router
125 + ", routerInterface=" + routerInterface
126 + ", floatingIP=" + neutronFloatingIP
127 + ", network=" + neutronNetwork
128 + ", loadBalancer=" + loadBalancer
129 + ", loadBalancerPool=" + loadBalancerPool
130 + ", loadBalancerPoolMember=" + loadBalancerPoolMember
131 + ", neutronsecurityRule=" + neutronSecurityRule
136 public int hashCode() {
137 final int prime = 31;
138 int result = super.hashCode();
139 result = prime * result + ((port == null) ? 0 : port.hashCode());
140 result = prime * result + ((subnet == null) ? 0 : subnet.hashCode());
141 result = prime * result + ((router == null) ? 0 : router.hashCode());
142 result = prime * result + ((routerInterface == null) ? 0 : routerInterface.hashCode());
143 result = prime * result + ((neutronFloatingIP == null) ? 0 : neutronFloatingIP.hashCode());
144 result = prime * result + ((neutronNetwork == null) ? 0 : neutronNetwork.hashCode());
145 result = prime * result + ((neutronSecurityRule == null) ? 0 : neutronSecurityRule.hashCode());
150 public boolean equals(Object obj) {
157 if (getClass() != obj.getClass()) {
160 if (!super.equals(obj)) {
163 NorthboundEvent other = (NorthboundEvent) obj;
165 if (other.port != null) {
168 } else if (!port.equals(other.port)) {
171 if (subnet == null) {
172 if (other.subnet != null) {
175 } else if (!subnet.equals(other.subnet)) {
178 if (router == null) {
179 if (other.router != null) {
182 } else if (!router.equals(other.router)) {
185 if (routerInterface == null) {
186 if (other.routerInterface != null) {
189 } else if (!routerInterface.equals(other.routerInterface)) {
192 if (neutronFloatingIP == null) {
193 if (other.neutronFloatingIP != null) {
196 } else if (!neutronFloatingIP.equals(other.neutronFloatingIP)) {
199 if (neutronNetwork == null) {
200 if (other.neutronNetwork != null) {
203 } else if (!neutronNetwork.equals(other.neutronNetwork)) {
206 if (loadBalancer == null) {
207 if (other.loadBalancer != null) {
210 } else if (!loadBalancer.equals(other.loadBalancer)) {
213 if (loadBalancerPool == null) {
214 if (other.loadBalancerPool != null) {
217 } else if (!loadBalancerPool.equals(other.loadBalancerPool)) {
220 if (loadBalancerPoolMember == null) {
221 if (other.loadBalancerPoolMember != null) {
224 } else if (!loadBalancerPoolMember.equals(other.loadBalancerPoolMember)) {
227 if (neutronSecurityRule == null) {
228 if (other.neutronSecurityRule != null) {
231 } else if (!neutronSecurityRule.equals(other.neutronSecurityRule)) {