kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 52f2cd1 | 2018-11-08 21:20:04 -0800 | [diff] [blame] | 2 | * Copyright 2018-present Open Networking Foundation |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [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 | */ |
Thomas Vachuska | 52f2cd1 | 2018-11-08 21:20:04 -0800 | [diff] [blame] | 16 | package org.onosproject.alarm; |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 17 | |
| 18 | import org.onosproject.event.AbstractEvent; |
| 19 | |
| 20 | /** |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 21 | * 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. |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 23 | */ |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 24 | public class AlarmEvent extends AbstractEvent<AlarmEvent.Type, Alarm> { |
kmcpeake | b172d5f | 2015-12-10 11:30:43 +0000 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Type of alarm event. |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 28 | */ |
| 29 | public enum Type { |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 30 | |
| 31 | /** |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 32 | * Individual alarm updated. |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 33 | */ |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 34 | CREATED, |
kmcpeake | b172d5f | 2015-12-10 11:30:43 +0000 | [diff] [blame] | 35 | /** |
Andrea Campanella | 65f9eb9 | 2017-05-02 11:36:14 -0700 | [diff] [blame] | 36 | * Individual alarm updated. |
| 37 | */ |
| 38 | UPDATED, |
| 39 | /** |
kmcpeake | b172d5f | 2015-12-10 11:30:43 +0000 | [diff] [blame] | 40 | * Alarm set updated for a given device. |
| 41 | */ |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 42 | REMOVED, |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Creates an event due to one alarm. |
| 47 | * |
Ray Milkey | bb23e0b | 2016-08-02 17:00:21 -0700 | [diff] [blame] | 48 | * @param type alarm type |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 49 | * @param alarm the alarm related to the event. |
| 50 | */ |
| 51 | public AlarmEvent(AlarmEvent.Type type, Alarm alarm) { |
| 52 | super(type, alarm); |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 53 | } |
| 54 | |
kmcpeake | 4fe18c8 | 2015-11-17 20:07:39 +0000 | [diff] [blame] | 55 | } |