blob: a380f2d0f7093952abbd8ed8b3690779ca7852ff [file] [log] [blame]
alshabib1d2bc402015-07-31 17:04:11 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
alshabib1d2bc402015-07-31 17:04:11 -07003 *
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 */
alshabib10c810b2015-08-18 16:59:04 -070016package org.onosproject.net.meter;
alshabib1d2bc402015-07-31 17:04:11 -070017
18import org.onosproject.event.AbstractEvent;
19
20/**
21 * Entity that represents Meter events.
22 */
alshabibeadfc8e2015-08-18 15:40:46 -070023public class MeterEvent extends AbstractEvent<MeterEvent.Type, Meter> {
alshabib1d2bc402015-07-31 17:04:11 -070024
25
alshabib7bb05012015-08-05 10:15:09 -070026 public enum Type {
alshabibeadfc8e2015-08-18 15:40:46 -070027 /**
28 * A meter addition was requested.
29 */
30 METER_ADD_REQ,
alshabib1d2bc402015-07-31 17:04:11 -070031
32 /**
alshabibeadfc8e2015-08-18 15:40:46 -070033 * A meter removal was requested.
alshabib1d2bc402015-07-31 17:04:11 -070034 */
Jordi Ortizdf28ecd2017-03-25 19:22:36 +010035 METER_REM_REQ,
36
37 /**
38 * A meter was finally added to device.
39 */
40 METER_ADDED,
41
42 /**
43 * A meter was finally removed from device.
44 */
Gamze Abakadadae722018-09-12 10:55:35 +000045 METER_REMOVED,
46
47 /**
48 * Meter is not used by any flow. It can be deleted.
49 */
50 METER_REFERENCE_COUNT_ZERO
alshabib1d2bc402015-07-31 17:04:11 -070051 }
52
53
54 /**
55 * Creates an event of a given type and for the specified meter and the
56 * current time.
57 *
58 * @param type meter event type
alshabibeadfc8e2015-08-18 15:40:46 -070059 * @param meter event subject
alshabib1d2bc402015-07-31 17:04:11 -070060 */
alshabibeadfc8e2015-08-18 15:40:46 -070061 public MeterEvent(Type type, Meter meter) {
62 super(type, meter);
alshabib1d2bc402015-07-31 17:04:11 -070063 }
64
65 /**
66 * Creates an event of a given type and for the specified meter and time.
67 *
68 * @param type meter event type
alshabibeadfc8e2015-08-18 15:40:46 -070069 * @param meter event subject
alshabib1d2bc402015-07-31 17:04:11 -070070 * @param time occurrence time
71 */
alshabibeadfc8e2015-08-18 15:40:46 -070072 public MeterEvent(Type type, Meter meter, long time) {
73 super(type, meter, time);
alshabib7bb05012015-08-05 10:15:09 -070074 }
75
alshabib1d2bc402015-07-31 17:04:11 -070076
77}