blob: 716449b5b12acde9324491105c88cc246dda2b2f [file] [log] [blame]
Andrea Campanella8e94b0c2016-04-12 13:58:07 -07001/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
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
19import org.onosproject.incubator.net.faultmanagement.alarm.Alarm;
20import org.onosproject.incubator.net.faultmanagement.alarm.AlarmEvent;
21import org.onosproject.incubator.net.faultmanagement.alarm.AlarmId;
22import 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 /**
56 * Stores an alarm.
57 *
58 * @param alarm alarm
59 */
60 void setAlarm(Alarm alarm);
61
62 /**
63 * Removes an alarm.
64 *
65 * @param alarmId alarm
66 */
67 void removeAlarm(AlarmId alarmId);
68}