blob: 0f788788d9110302925f96b03e8686de65dc93ae [file] [log] [blame]
kmcpeake4fe18c82015-11-17 20:07:39 +00001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
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 /**
Andrea Campanella65f9eb92017-05-02 11:36:14 -070036 * Individual alarm updated.
37 */
38 UPDATED,
39 /**
kmcpeakeb172d5f2015-12-10 11:30:43 +000040 * Alarm set updated for a given device.
41 */
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070042 REMOVED,
43 }
44
45 /**
46 * Creates an event due to one alarm.
47 *
Ray Milkeybb23e0b2016-08-02 17:00:21 -070048 * @param type alarm type
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070049 * @param alarm the alarm related to the event.
50 */
51 public AlarmEvent(AlarmEvent.Type type, Alarm alarm) {
52 super(type, alarm);
kmcpeake4fe18c82015-11-17 20:07:39 +000053 }
54
kmcpeake4fe18c82015-11-17 20:07:39 +000055}