Jonathan Hart | c36c955 | 2018-07-31 15:07:53 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.opencord.dhcpl2relay; |
| 18 | |
| 19 | import org.onosproject.event.AbstractEvent; |
| 20 | import org.onosproject.net.ConnectPoint; |
| 21 | |
| 22 | /** |
| 23 | * Dhcp L2 relay event. |
| 24 | */ |
| 25 | public class DhcpL2RelayEvent extends AbstractEvent<DhcpL2RelayEvent.Type, DhcpAllocationInfo> { |
| 26 | |
| 27 | private final ConnectPoint connectPoint; |
| 28 | |
| 29 | /** |
| 30 | * Type of the event. |
| 31 | */ |
| 32 | public enum Type { |
| 33 | /** |
| 34 | * DHCP lease was updated. |
| 35 | */ |
| 36 | UPDATED, |
| 37 | |
| 38 | /** |
| 39 | * DHCP lease was removed. |
| 40 | */ |
| 41 | REMOVED |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Creates a new event. |
| 46 | * |
| 47 | * @param type type of the event |
| 48 | * @param allocationInfo DHCP allocation info |
| 49 | * @param connectPoint connect point the client is on |
| 50 | */ |
| 51 | public DhcpL2RelayEvent(Type type, DhcpAllocationInfo allocationInfo, ConnectPoint connectPoint) { |
| 52 | super(type, allocationInfo); |
| 53 | this.connectPoint = connectPoint; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Gets the DHCP client connect point. |
| 58 | * |
| 59 | * @return connect point |
| 60 | */ |
| 61 | public ConnectPoint connectPoint() { |
| 62 | return connectPoint; |
| 63 | } |
| 64 | } |