2 * Copyright (c) 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
8 package org.opendaylight.ovsdb.openstack.netvirt;
10 import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
14 public class NeutronL3AdapterEvent extends AbstractEvent {
16 SUBTYPE_EXTERNAL_MAC_UPDATE; // TODO: Add more subtypes as they come here
18 public static final int size = HandlerType.values().length;
21 private final SubType subtype;
23 private final Long bridgeDpid;
24 private final IpAddress gatewayIpAddress;
25 private final MacAddress macAddress;
27 public NeutronL3AdapterEvent(final Long bridgeDpid, final IpAddress gatewayIpAddress, final MacAddress macAddress) {
28 super(HandlerType.NEUTRON_L3_ADAPTER, Action.UPDATE);
30 this.subtype = SubType.SUBTYPE_EXTERNAL_MAC_UPDATE;
31 this.bridgeDpid = bridgeDpid;
32 this.gatewayIpAddress = gatewayIpAddress;
33 this.macAddress = macAddress;
36 public SubType getSubType() {
40 public Long getBridgeDpid() {
43 public IpAddress getGatewayIpAddress() {
44 return gatewayIpAddress;
46 public MacAddress getMacAddress() {
51 public String toString() {
52 return "NeutronL3AdapterEvent [handler=" + super.getHandlerType()
53 + ", action=" + super.getAction()
54 + ", subtype=" + subtype
55 + ", bridgeDpid=" + bridgeDpid
56 + ", gatewayIpAddress=" + gatewayIpAddress
57 + ", macAddress=" + macAddress
62 public int hashCode() {
64 int result = super.hashCode();
65 result = prime * result + ((subtype == null) ? 0 : subtype.hashCode());
66 result = prime * result + ((bridgeDpid == null) ? 0 : bridgeDpid.hashCode());
67 result = prime * result + ((gatewayIpAddress == null) ? 0 : gatewayIpAddress.hashCode());
68 result = prime * result + ((macAddress == null) ? 0 : macAddress.hashCode());
73 public boolean equals(Object obj) {
80 if (getClass() != obj.getClass()) {
83 if (!super.equals(obj)) {
86 NeutronL3AdapterEvent other = (NeutronL3AdapterEvent) obj;
87 if (subtype == null) {
88 if (other.subtype != null) {
91 } else if (!subtype.equals(other.subtype)) {
94 if (bridgeDpid == null) {
95 if (other.bridgeDpid != null) {
98 } else if (!bridgeDpid.equals(other.bridgeDpid)) {
101 if (gatewayIpAddress == null) {
102 if (other.gatewayIpAddress != null) {
105 } else if (!gatewayIpAddress.equals(other.gatewayIpAddress)) {
108 if (macAddress == null) {
109 if (other.macAddress != null) {
112 } else if (!macAddress.equals(other.macAddress)) {