blob: 765fbfef286fd9e378ab0b10b444af4d2213c19f [file] [log] [blame]
kmcpeake4fe18c82015-11-17 20:07:39 +00001/*
2 * Copyright 2014-2015 Open Networking Laboratory
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 */
16package org.onosproject.incubator.net.faultmanagement.alarm;
17
18import org.onosproject.net.DeviceId;
19
20/**
21 * Representation of an Alarm. At a given instant there can be only one alarm
22 * with the same deviceId + description + source combination.
23 */
24public interface Alarm {
25
26 /**
27 * Returns the unique alarm id within this ONOS instance.
28 *
29 * @return alarm identifier
30 */
31 AlarmId id();
32
33 /**
34 * The device to which this alarm is related.
35 *
36 * @return a device id
37 */
38 DeviceId deviceId();
39
40 /**
41 * Returns a description of alarm.
42 * <p>
43 * It may encapsulate Event Type as described by ITU Recommendation X.736
44 * ITU, Quoting https://tools.ietf.org/html/rfc3877 these include: other,
45 * communicationsAlarm, qualityOfServiceAlarm, processingErrorAlarm,
46 * equipmentAlarm, environmentalAlarm, integrityViolation,
47 * operationalViolation, physicalViolation,
48 * securityServiceOrMechanismViolation, timeDomainViolation
49 * <p>
50 * It may encapsulate Probable Cause as described by ITU Recommendation
51 * X.736 ITU, Quoting
52 * https://www.iana.org/assignments/ianaitualarmtc-mib/ianaitualarmtc-mib
53 * these include : aIS, callSetUpFailure, degradedSignal,
54 * farEndReceiverFailure, framingError, and hundreds more constants.
55 * <p>
56 * It may encapsulate a vendor-specific description of the underlying fault.
57 *
58 * @return description of alarm
59 */
60 String description();
61
62 /**
63 * Returns an entity within the context of this alarm's device. It may be
64 * null if deviceId sufficiently identifies the location. As an example, the
65 * source may indicate a port number
66 *
67 * @return source of alarm within the alarm's referenced Device.
68 */
69 AlarmEntityId source();
70
71 /**
72 * Returns the time when raised.
73 *
74 * @return time when raised, in milliseconds since start of epoch
75 */
76 long timeRaised();
77
78 /**
79 * Returns time at which the alarm was updated most recently, due to some
80 * change in the device, or ONOS. If the alarm has been cleared, this is the
81 * time at which the alarm was cleared.
82 *
83 * @return time when last updated, in milliseconds since start of epoch
84 */
85 long timeUpdated();
86
87 /**
88 * Returns the time when cleared. Null indicated no clear time, i.e. the
89 * alarm is still active.
90 *
91 * @return time when cleared, in milliseconds since start of epoch or null
92 * if uncleared.
93 */
94 Long timeCleared();
95
96 /**
97 * Returns the severity. Note, that cleared alarms may have EITHER
98 * SeverityLevel = CLEARED, or may be not present; both scenarios should be
99 * handled.
100 *
101 * @return severity of the alarm
102 */
103 SeverityLevel severity();
104
105 /**
106 * Returns true if alarm is service affecting Note: Whilst X.733 combines
107 * service-affecting state with severity (where severities of critical and
108 * major are deemed service-affecting) ONOS keeps these attributes separate.
109 *
110 * @return whether service affecting (true indicates it is)
111 */
112 boolean serviceAffecting();
113
114 /**
115 * Returns a flag to indicate if this alarm has been acknowledged. All
116 * alarms are unacknowledged until and unless an ONOS user takes action to
117 * indicate so.
118 *
119 * @return whether alarm is currently acknowledged (true indicates it is)
120 */
121 boolean acknowledged();
122
123 /**
124 * Returns a flag to indicate if this alarm is manually-cleared by a user action within ONOS. Some stateless events
125 * e.g. backup-failure or upgrade-failure, may be mapped by ONOS to alarms, and these may be deemed manually-
126 * clearable. The more typical case is that an alarm represents a persistent fault on or related to a device and
127 * such alarms are never manually clearable, i.e. a configuration or operational state must occur for the alarm to
128 * clear.
129 *
130 * @return whether it may be cleared by a user action (true indicates it is)
131 */
132 boolean manuallyClearable();
133
134 /**
135 * Returns the user to whom this alarm is assigned; this is for future use
136 * and always returns null in this release. It is anticipated that in future ONOS
137 * releases, the existing JAAS user/key/role configuration will be extended
138 * to include a mechanism whereby some groups of users may allocate alarms
139 * to other users for bookkeeping and administrative purposes, and that ONOS
140 * will additionally provide a REST based mechanism, to retrieve from JAAS,
141 * the set of users to whom alarm assignment is possible for the current
142 * user.
143 *
144 * @return the assigned user; always null in this release.
145 */
146 String assignedUser();
147
148 /**
149 * Represents the severity level on an alarm, as per ITU-T X.733
150 * specifications.
151 * <p>
152 * The precedence is as follows for : Critical &gt; Major &gt; Minor &gt; Warning.
153 */
154 enum SeverityLevel {
155
156 /**
157 * From X.733: This indicates the clearing of one or more previously
158 * reported alarms. This alarm clears all alarms for this managed object
159 * that have the same Alarm type, Probable cause and Specific problems
160 * (if given). Multiple associated notifications may be cleared by using
161 * the Correlated notifications parameter (defined below). This
162 * Recommendation | International Standard does not require that the
163 * clearing of previously reported alarms be reported. Therefore, a
164 * managing system cannot assume that the absence of an alarm with the
165 * Cleared severity level means that the condition that caused the
166 * generation of previous alarms is still present. Managed object
167 * definers shall state if, and under which conditions, the Cleared
168 * severity level is used.
169 */
170 CLEARED,
171 /**
172 * From X.733: This indicates that the severity level cannot be
173 * determined.
174 */
175 INDETERMINATE,
176 /**
177 * From X.733: This indicates that a service affecting condition has
178 * occurred and an immediate corrective action is required. Such a
179 * severity can be reported, for example, when a managed object becomes
180 * totally out of service and its capability must be restored.
181 */
182 CRITICAL,
183 /**
184 * X.733 definition: This indicates that a service affecting condition
185 * has developed and an urgent corrective action is required. Such a
186 * severity can be reported, for example, when there is a severe
187 * degradation in the capability of the managed object and its full
188 * capability must be restored.
189 */
190 MAJOR,
191 /**
192 * From X.733: This indicates the existence of a non-service affecting
193 * fault condition and that corrective action should be taken in order
194 * to prevent a more serious (for example, service affecting) fault.
195 * Such a severity can be reported, for example, when the detected alarm
196 * condition is not currently degrading the capacity of the managed
197 * object.
198 */
199 MINOR,
200 /**
201 * From X.733: This indicates the detection of a potential or impending
202 * service affecting fault, before any significant effects have been
203 * felt. Action should be taken to further diagnose (if necessary) and
204 * correct the problem in order to prevent it from becoming a more
205 * serious service affecting fault.
206 */
207 WARNING;
208
209 }
210
211}