alshabib | 1d2bc40 | 2015-07-31 17:04:11 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2015 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 | package org.onosproject.incubator.net.meter; |
| 17 | |
| 18 | import org.onosproject.event.AbstractEvent; |
| 19 | |
| 20 | /** |
| 21 | * Entity that represents Meter events. |
| 22 | */ |
| 23 | public class MeterEvent extends AbstractEvent<MeterEvent.Type, Meter> { |
| 24 | |
| 25 | |
| 26 | enum Type { |
| 27 | |
| 28 | /** |
| 29 | * Signals that a new meter has been added. |
| 30 | */ |
| 31 | METER_ADDED, |
| 32 | |
| 33 | /** |
| 34 | * Signals that a meter has been removed. |
| 35 | */ |
| 36 | METER_REMOVED, |
| 37 | |
| 38 | /** |
| 39 | * Signals that a meter has been added. |
| 40 | */ |
| 41 | METER_UPDATED, |
| 42 | |
| 43 | /** |
| 44 | * Signals that a meter addition failed. |
| 45 | */ |
| 46 | METER_ADD_FAILED, |
| 47 | |
| 48 | /** |
| 49 | * Signals that a meter removal failed. |
| 50 | */ |
| 51 | METER_REMOVE_FAILED, |
| 52 | |
| 53 | /** |
| 54 | * Signals that a meter update failed. |
| 55 | */ |
| 56 | METER_UPDATE_FAILED |
| 57 | } |
| 58 | |
| 59 | |
| 60 | /** |
| 61 | * Creates an event of a given type and for the specified meter and the |
| 62 | * current time. |
| 63 | * |
| 64 | * @param type meter event type |
| 65 | * @param meter event subject |
| 66 | */ |
| 67 | public MeterEvent(Type type, Meter meter) { |
| 68 | super(type, meter); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Creates an event of a given type and for the specified meter and time. |
| 73 | * |
| 74 | * @param type meter event type |
| 75 | * @param meter event subject |
| 76 | * @param time occurrence time |
| 77 | */ |
| 78 | public MeterEvent(Type type, Meter meter, long time) { |
| 79 | super(type, meter, time); |
| 80 | } |
| 81 | |
| 82 | } |