blob: 370e6879178f86a8705f64b5c309aed523ad8cf6 [file] [log] [blame]
Andrea Campanella8e94b0c2016-04-12 13:58:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Andrea Campanella8e94b0c2016-04-12 13:58:07 -07003 *
Ray Milkey85267002016-11-16 11:06:35 -08004 * Licensed under the Apache License, Version 2.0 (the "License");
Andrea Campanella8e94b0c2016-04-12 13:58:07 -07005 * 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
17package org.onosproject.faultmanagement.api;
18
Thomas Vachuska52f2cd12018-11-08 21:20:04 -080019import org.onosproject.alarm.Alarm;
20import org.onosproject.alarm.AlarmEvent;
21import org.onosproject.alarm.AlarmId;
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070022import org.onosproject.net.DeviceId;
23import org.onosproject.store.Store;
24
25import java.util.Collection;
26
27/**
28 * Manages inventory of alarms; not intended for direct use.
29 */
30public 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 Campanella65f9eb92017-05-02 11:36:14 -070056 * Stores or updates an alarm.
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070057 *
58 * @param alarm alarm
59 */
Andrea Campanella65f9eb92017-05-02 11:36:14 -070060
61 void createOrUpdateAlarm(Alarm alarm);
Andrea Campanella8e94b0c2016-04-12 13:58:07 -070062
63 /**
64 * Removes an alarm.
65 *
66 * @param alarmId alarm
67 */
68 void removeAlarm(AlarmId alarmId);
69}