blob: 8c2acb4bca2d035796b6cf1e5de9be1ea28aea0d [file] [log] [blame]
Brian Stankeaa6211a2016-02-04 18:22:54 -05001/*
2 * Copyright 2016 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 */
16
17package org.onosproject.incubator.net.key;
18
19import com.google.common.annotations.Beta;
20import org.onosproject.event.AbstractEvent;
21
22/**
23 * Describes device key events.
24 */
25@Beta
26public class DeviceKeyEvent extends AbstractEvent<DeviceKeyEvent.Type, DeviceKey> {
27
28 /**
29 * Type of device key events.
30 */
31 public enum Type {
32 /**
33 * Signals that a new device key has been added.
34 */
35 DEVICE_KEY_ADDED,
36
37 /**
38 * Signals that a device key has been updated or changed state.
39 */
40 DEVICE_KEY_UPDATED,
41
42 /**
43 * Signals that a device key has been removed.
44 */
45 DEVICE_KEY_REMOVED
46 }
47
48 /**
49 * Creates an event of a given type, and for the specified device key.
50 *
51 * @param type device key event type
52 * @param deviceKey event device key subject
53 */
54 public DeviceKeyEvent(Type type, DeviceKey deviceKey) {
55 super(type, deviceKey);
56 }
57
58 /**
59 * Creates an event of a given type, for the specified device key, and
60 * the current time.
61 *
62 * @param type device key event type
63 * @param deviceKey event device key subject
64 * @param time occurrence time
65 */
66 public DeviceKeyEvent(Type type, DeviceKey deviceKey, long time) {
67 super(type, deviceKey, time);
68 }
69}