Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 3 | * |
Ray Milkey | 8526700 | 2016-11-16 11:06:35 -0800 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.faultmanagement.api; |
| 18 | |
Thomas Vachuska | 52f2cd1 | 2018-11-08 21:20:04 -0800 | [diff] [blame^] | 19 | import org.onosproject.alarm.Alarm; |
| 20 | import org.onosproject.alarm.AlarmEvent; |
| 21 | import org.onosproject.alarm.AlarmId; |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 22 | import org.onosproject.net.DeviceId; |
| 23 | import org.onosproject.store.Store; |
| 24 | |
| 25 | import java.util.Collection; |
| 26 | |
| 27 | /** |
| 28 | * Manages inventory of alarms; not intended for direct use. |
| 29 | */ |
| 30 | public interface AlarmStore extends Store<AlarmEvent, AlarmStoreDelegate> { |
| 31 | |
| 32 | /** |
| 33 | * Retrieves and alarm based on it's id. |
| 34 | * |
| 35 | * @param alarmId alarm identifier |
| 36 | * @return alarm |
| 37 | */ |
| 38 | Alarm getAlarm(AlarmId alarmId); |
| 39 | |
| 40 | /** |
| 41 | * Retrieves all alarms present in the system. |
| 42 | * |
| 43 | * @return alarms |
| 44 | */ |
| 45 | Collection<Alarm> getAlarms(); |
| 46 | |
| 47 | /** |
| 48 | * Retrieves alarms for a device. |
| 49 | * |
| 50 | * @param deviceId device identifier |
| 51 | * @return alarms |
| 52 | */ |
| 53 | Collection<Alarm> getAlarms(DeviceId deviceId); |
| 54 | |
| 55 | /** |
Andrea Campanella | 65f9eb9 | 2017-05-02 11:36:14 -0700 | [diff] [blame] | 56 | * Stores or updates an alarm. |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 57 | * |
| 58 | * @param alarm alarm |
| 59 | */ |
Andrea Campanella | 65f9eb9 | 2017-05-02 11:36:14 -0700 | [diff] [blame] | 60 | |
| 61 | void createOrUpdateAlarm(Alarm alarm); |
Andrea Campanella | 8e94b0c | 2016-04-12 13:58:07 -0700 | [diff] [blame] | 62 | |
| 63 | /** |
| 64 | * Removes an alarm. |
| 65 | * |
| 66 | * @param alarmId alarm |
| 67 | */ |
| 68 | void removeAlarm(AlarmId alarmId); |
| 69 | } |