blob: 808a3e8fa76e8c298be8203b108f2c4419ad80b2 [file] [log] [blame]
alshabib1d2bc402015-07-31 17:04:11 -07001/*
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 */
16package org.onosproject.incubator.net.meter;
17
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 */
alshabibeadfc8e2015-08-18 15:40:46 -070035 METER_REM_REQ
alshabib1d2bc402015-07-31 17:04:11 -070036 }
37
38
39 /**
40 * Creates an event of a given type and for the specified meter and the
41 * current time.
42 *
43 * @param type meter event type
alshabibeadfc8e2015-08-18 15:40:46 -070044 * @param meter event subject
alshabib1d2bc402015-07-31 17:04:11 -070045 */
alshabibeadfc8e2015-08-18 15:40:46 -070046 public MeterEvent(Type type, Meter meter) {
47 super(type, meter);
alshabib1d2bc402015-07-31 17:04:11 -070048 }
49
50 /**
51 * Creates an event of a given type and for the specified meter and time.
52 *
53 * @param type meter event type
alshabibeadfc8e2015-08-18 15:40:46 -070054 * @param meter event subject
alshabib1d2bc402015-07-31 17:04:11 -070055 * @param time occurrence time
56 */
alshabibeadfc8e2015-08-18 15:40:46 -070057 public MeterEvent(Type type, Meter meter, long time) {
58 super(type, meter, time);
alshabib7bb05012015-08-05 10:15:09 -070059 }
60
alshabib1d2bc402015-07-31 17:04:11 -070061
62}