Package org.onosproject.alarm
Interface AlarmService
-
- All Superinterfaces:
ListenerService<AlarmEvent,AlarmListener>
public interface AlarmService extends ListenerService<AlarmEvent,AlarmListener>
Service for interacting with the alarm handling of devices. Unless stated otherwise, getter methods return active AND recently-cleared alarms.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Set<Alarm>getActiveAlarms()Returns all of the ACTIVE alarms.default java.util.Set<Alarm>getActiveAlarms(DeviceId deviceId)Returns all of the ACTIVE alarms for a specific device.AlarmgetAlarm(AlarmId alarmId)Returns the alarm with the specified identifier.java.util.Map<Alarm.SeverityLevel,java.lang.Long>getAlarmCounts()Returns summary of alarms on all devices.java.util.Map<Alarm.SeverityLevel,java.lang.Long>getAlarmCounts(DeviceId deviceId)Returns summary of alarms on a given device.java.util.Set<Alarm>getAlarms()Returns all of the alarms.java.util.Set<Alarm>getAlarms(Alarm.SeverityLevel severity)Returns the alarms with the specified severity.java.util.Set<Alarm>getAlarms(DeviceId deviceId)Returns the alarm matching a given device, regardless of source within that device.java.util.Set<Alarm>getAlarms(DeviceId deviceId, AlarmEntityId source)Returns the alarm for a given device and source.java.util.Set<Alarm>getAlarmsForFlow(DeviceId deviceId, long flowId)Returns the alarm affecting a given flow.java.util.Set<Alarm>getAlarmsForLink(ConnectPoint src, ConnectPoint dst)Returns the alarm affecting a given link.voidremove(AlarmId id)Remove an alarm from ONOS.AlarmupdateBookkeepingFields(AlarmId id, boolean clear, boolean isAcknowledged, java.lang.String assignedUser)Update book-keeping (ie administrative) fields for the alarm matching the specified identifier.-
Methods inherited from interface org.onosproject.event.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
updateBookkeepingFields
Alarm updateBookkeepingFields(AlarmId id, boolean clear, boolean isAcknowledged, java.lang.String assignedUser)
Update book-keeping (ie administrative) fields for the alarm matching the specified identifier.- Parameters:
id- alarm identifierclear- true if the alarm has to be clearedisAcknowledged- new acknowledged stateassignedUser- new assigned user, null clear- Returns:
- updated alarm (including any recent device-derived changes)
-
remove
void remove(AlarmId id)
Remove an alarm from ONOS.- Parameters:
id- alarm
-
getAlarmCounts
java.util.Map<Alarm.SeverityLevel,java.lang.Long> getAlarmCounts(DeviceId deviceId)
Returns summary of alarms on a given device.- Parameters:
deviceId- the device- Returns:
- map of severity (if applicable) vs alarm counts; empty map if either the device has no alarms or identified device is not managed.
-
getAlarmCounts
java.util.Map<Alarm.SeverityLevel,java.lang.Long> getAlarmCounts()
Returns summary of alarms on all devices.- Returns:
- map of severity (if applicable) vs alarm counts; empty map if no alarms.
-
getAlarm
Alarm getAlarm(AlarmId alarmId)
Returns the alarm with the specified identifier.- Parameters:
alarmId- alarm identifier- Returns:
- alarm matching id; null if no alarm matches the identifier.
-
getAlarms
java.util.Set<Alarm> getAlarms()
Returns all of the alarms.- Returns:
- set of alarms; empty set if no alarms
-
getActiveAlarms
java.util.Set<Alarm> getActiveAlarms()
Returns all of the ACTIVE alarms. Recently cleared alarms excluded.- Returns:
- set of alarms; empty set if no alarms
-
getAlarms
java.util.Set<Alarm> getAlarms(Alarm.SeverityLevel severity)
Returns the alarms with the specified severity.- Parameters:
severity- the alarm severity- Returns:
- set of alarms with a particular severity; empty set if no alarms
-
getAlarms
java.util.Set<Alarm> getAlarms(DeviceId deviceId)
Returns the alarm matching a given device, regardless of source within that device.- Parameters:
deviceId- the device to use when searching alarms.- Returns:
- set of alarms; empty set if no alarms
-
getActiveAlarms
default java.util.Set<Alarm> getActiveAlarms(DeviceId deviceId)
Returns all of the ACTIVE alarms for a specific device. Recently cleared alarms excluded.- Parameters:
deviceId- the device to use when searching alarms.- Returns:
- set of alarms; empty set if no alarms
-
getAlarms
java.util.Set<Alarm> getAlarms(DeviceId deviceId, AlarmEntityId source)
Returns the alarm for a given device and source.- Parameters:
deviceId- the devicesource- the source within the device- Returns:
- set of alarms; empty set if no alarms
-
getAlarmsForLink
java.util.Set<Alarm> getAlarmsForLink(ConnectPoint src, ConnectPoint dst)
Returns the alarm affecting a given link.- Parameters:
src- one end of the linkdst- one end of the link- Returns:
- set of alarms; empty set if no alarms
-
-