blob: 9481b0161d0f2fb60335a8acbc32acbacd9775fd [file] [log] [blame]
kmcpeake4fe18c82015-11-17 20:07:39 +00001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
kmcpeake4fe18c82015-11-17 20:07:39 +00003 *
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.faultmanagement.alarm;
17
18import org.onosproject.event.AbstractEvent;
19
20/**
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070021 * Entity that represents Alarm events. Note: although the event will itself have a time,
22 * consumers may be more interested in the times embedded in the alarms themselves.
kmcpeake4fe18c82015-11-17 20:07:39 +000023 */
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070024public class AlarmEvent extends AbstractEvent<AlarmEvent.Type, Alarm> {
kmcpeakeb172d5f2015-12-10 11:30:43 +000025
26 /**
27 * Type of alarm event.
kmcpeake4fe18c82015-11-17 20:07:39 +000028 */
29 public enum Type {
kmcpeake4fe18c82015-11-17 20:07:39 +000030
31 /**
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070032 * Individual alarm updated.
kmcpeake4fe18c82015-11-17 20:07:39 +000033 */
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070034 CREATED,
kmcpeakeb172d5f2015-12-10 11:30:43 +000035 /**
36 * Alarm set updated for a given device.
37 */
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070038 REMOVED,
39 }
40
41 /**
42 * Creates an event due to one alarm.
43 *
Ray Milkeybb23e0b2016-08-02 17:00:21 -070044 * @param type alarm type
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070045 * @param alarm the alarm related to the event.
46 */
47 public AlarmEvent(AlarmEvent.Type type, Alarm alarm) {
48 super(type, alarm);
kmcpeake4fe18c82015-11-17 20:07:39 +000049 }
50
kmcpeake4fe18c82015-11-17 20:07:39 +000051}