alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 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 | */ |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame] | 16 | package org.onosproject.net.meter; |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 17 | |
| 18 | import org.onosproject.event.AbstractEvent; |
| 19 | |
| 20 | /** |
| 21 | * Entity that represents Meter events. |
| 22 | */ |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 23 | public class MeterEvent extends AbstractEvent<MeterEvent.Type, Meter> { |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 24 | |
| 25 | |
alshabib | 7bb0501 | 2015-08-05 10:15:09 -0700 | [diff] [blame] | 26 | public enum Type { |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 27 | /** |
| 28 | * A meter addition was requested. |
| 29 | */ |
| 30 | METER_ADD_REQ, |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 33 | * A meter removal was requested. |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 34 | */ |
Jordi Ortiz | df28ecd | 2017-03-25 19:22:36 +0100 | [diff] [blame] | 35 | 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 | */ |
| 45 | METER_REMOVED |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | |
| 49 | /** |
| 50 | * Creates an event of a given type and for the specified meter and the |
| 51 | * current time. |
| 52 | * |
| 53 | * @param type meter event type |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 54 | * @param meter event subject |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 55 | */ |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 56 | public MeterEvent(Type type, Meter meter) { |
| 57 | super(type, meter); |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Creates an event of a given type and for the specified meter and time. |
| 62 | * |
| 63 | * @param type meter event type |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 64 | * @param meter event subject |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 65 | * @param time occurrence time |
| 66 | */ |
alshabib | eadfc8e | 2015-08-18 15:40:46 -0700 | [diff] [blame] | 67 | public MeterEvent(Type type, Meter meter, long time) { |
| 68 | super(type, meter, time); |
alshabib | 7bb0501 | 2015-08-05 10:15:09 -0700 | [diff] [blame] | 69 | } |
| 70 | |
alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame] | 71 | |
| 72 | } |