blob: 364197d1137ffeaeef1529c3d09a4a9ee23ec9cf [file] [log] [blame]
Jonathan Hartc36c9552018-07-31 15:07:53 -04001/*
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
17package org.opencord.dhcpl2relay;
18
19import org.onosproject.event.AbstractEvent;
20import org.onosproject.net.ConnectPoint;
21
22/**
23 * Dhcp L2 relay event.
24 */
25public 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}