blob: 98329df04c3f1b7673b41624343dd54b8d579912 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.host;
tom64b7aac2014-08-26 00:18:21 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.event.AbstractEvent;
19import org.onosproject.net.Host;
tom64b7aac2014-08-26 00:18:21 -070020
21/**
22 * Describes end-station host event.
23 */
24public class HostEvent extends AbstractEvent<HostEvent.Type, Host> {
25
26 /**
27 * Type of host events.
28 */
29 public enum Type {
30 /**
31 * Signifies that a new host has been detected.
32 */
33 HOST_ADDED,
34
35 /**
36 * Signifies that a host has been removed.
37 */
38 HOST_REMOVED,
39
40 /**
tom7869ad92014-09-09 14:32:08 -070041 * Signifies that host data changed, e.g. IP address
42 */
43 HOST_UPDATED,
44
45 /**
tom64b7aac2014-08-26 00:18:21 -070046 * Signifies that a host location has changed.
47 */
48 HOST_MOVED
49 }
50
51 /**
52 * Creates an event of a given type and for the specified host and the
53 * current time.
54 *
55 * @param type host event type
56 * @param host event host subject
57 */
58 public HostEvent(Type type, Host host) {
59 super(type, host);
60 }
61
62 /**
63 * Creates an event of a given type and for the specified host and time.
64 *
65 * @param type host event type
66 * @param host event host subject
67 * @param time occurrence time
68 */
69 public HostEvent(Type type, Host host, long time) {
70 super(type, host, time);
71 }
72
73}