Class DefaultAlarm

  • All Implemented Interfaces:
    Alarm

    public final class DefaultAlarm
    extends java.lang.Object
    implements Alarm
    Default implementation of an alarm.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DefaultAlarm.Builder
      Builder for the DefaultAlarm object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acknowledged()
      Returns a flag to indicate if this alarm has been acknowledged.
      java.lang.String assignedUser()
      Returns the user to whom this alarm is assigned; this is for future use and always returns null in this release.
      boolean cleared()
      Returns a flag to indicate if this alarm has been cleared.
      java.lang.String description()
      Returns a description of alarm.
      DeviceId deviceId()
      The device to which this alarm is related.
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      AlarmId id()
      Returns the unique alarm id within this ONOS instance.
      boolean manuallyClearable()
      Returns a flag to indicate if this alarm is manually-cleared by a user action within ONOS.
      boolean serviceAffecting()
      Returns true if alarm is service affecting Note: Whilst X.733 combines service-affecting state with severity (where severities of critical and major are deemed service-affecting) ONOS keeps these attributes separate.
      Alarm.SeverityLevel severity()
      Returns the severity.
      AlarmEntityId source()
      Returns an entity within the context of this alarm's device.
      java.lang.Long timeCleared()
      Returns the time when cleared.
      long timeRaised()
      Returns the time when raised.
      long timeUpdated()
      Returns time at which the alarm was updated most recently, due to some change in the device, or ONOS.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • id

        public AlarmId id()
        Description copied from interface: Alarm
        Returns the unique alarm id within this ONOS instance.
        Specified by:
        id in interface Alarm
        Returns:
        alarm identifier
      • deviceId

        public DeviceId deviceId()
        Description copied from interface: Alarm
        The device to which this alarm is related.
        Specified by:
        deviceId in interface Alarm
        Returns:
        a device id
      • description

        public java.lang.String description()
        Description copied from interface: Alarm
        Returns a description of alarm.

        It may encapsulate Event Type as described by ITU Recommendation X.736 ITU, Quoting https://tools.ietf.org/html/rfc3877 these include: other, communicationsAlarm, qualityOfServiceAlarm, processingErrorAlarm, equipmentAlarm, environmentalAlarm, integrityViolation, operationalViolation, physicalViolation, securityServiceOrMechanismViolation, timeDomainViolation

        It may encapsulate Probable Cause as described by ITU Recommendation X.736 ITU, Quoting https://www.iana.org/assignments/ianaitualarmtc-mib/ianaitualarmtc-mib these include : aIS, callSetUpFailure, degradedSignal, farEndReceiverFailure, framingError, and hundreds more constants.

        It may encapsulate a vendor-specific description of the underlying fault.

        Specified by:
        description in interface Alarm
        Returns:
        description of alarm
      • source

        public AlarmEntityId source()
        Description copied from interface: Alarm
        Returns an entity within the context of this alarm's device. It may be null if deviceId sufficiently identifies the location. As an example, the source may indicate a port number
        Specified by:
        source in interface Alarm
        Returns:
        source of alarm within the alarm's referenced Device.
      • timeRaised

        public long timeRaised()
        Description copied from interface: Alarm
        Returns the time when raised.
        Specified by:
        timeRaised in interface Alarm
        Returns:
        time when raised, in milliseconds since start of epoch
      • timeUpdated

        public long timeUpdated()
        Description copied from interface: Alarm
        Returns time at which the alarm was updated most recently, due to some change in the device, or ONOS. If the alarm has been cleared, this is the time at which the alarm was cleared.
        Specified by:
        timeUpdated in interface Alarm
        Returns:
        time when last updated, in milliseconds since start of epoch
      • timeCleared

        public java.lang.Long timeCleared()
        Description copied from interface: Alarm
        Returns the time when cleared. Null indicated no clear time, i.e. the alarm is still active.
        Specified by:
        timeCleared in interface Alarm
        Returns:
        time when cleared, in milliseconds since start of epoch or null if uncleared.
      • severity

        public Alarm.SeverityLevel severity()
        Description copied from interface: Alarm
        Returns the severity. Note, that cleared alarms may have EITHER SeverityLevel = CLEARED, or may be not present; both scenarios should be handled.
        Specified by:
        severity in interface Alarm
        Returns:
        severity of the alarm
      • serviceAffecting

        public boolean serviceAffecting()
        Description copied from interface: Alarm
        Returns true if alarm is service affecting Note: Whilst X.733 combines service-affecting state with severity (where severities of critical and major are deemed service-affecting) ONOS keeps these attributes separate.
        Specified by:
        serviceAffecting in interface Alarm
        Returns:
        whether service affecting (true indicates it is)
      • acknowledged

        public boolean acknowledged()
        Description copied from interface: Alarm
        Returns a flag to indicate if this alarm has been acknowledged. All alarms are unacknowledged until and unless an ONOS user takes action to indicate so.
        Specified by:
        acknowledged in interface Alarm
        Returns:
        whether alarm is currently acknowledged (true indicates it is)
      • cleared

        public boolean cleared()
        Description copied from interface: Alarm
        Returns a flag to indicate if this alarm has been cleared. All alarms are not cleared until and unless an ONOS user or app takes action to indicate so.
        Specified by:
        cleared in interface Alarm
        Returns:
        whether alarm is currently cleared (true indicates it is)
      • manuallyClearable

        public boolean manuallyClearable()
        Description copied from interface: Alarm
        Returns a flag to indicate if this alarm is manually-cleared by a user action within ONOS. Some stateless events e.g. backup-failure or upgrade-failure, may be mapped by ONOS to alarms, and these may be deemed manually- clearable. The more typical case is that an alarm represents a persistent fault on or related to a device and such alarms are never manually clearable, i.e. a configuration or operational state must occur for the alarm to clear.
        Specified by:
        manuallyClearable in interface Alarm
        Returns:
        whether it may be cleared by a user action (true indicates it is)
      • assignedUser

        public java.lang.String assignedUser()
        Description copied from interface: Alarm
        Returns the user to whom this alarm is assigned; this is for future use and always returns null in this release. It is anticipated that in future ONOS releases, the existing JAAS user/key/role configuration will be extended to include a mechanism whereby some groups of users may allocate alarms to other users for bookkeeping and administrative purposes, and that ONOS will additionally provide a REST based mechanism, to retrieve from JAAS, the set of users to whom alarm assignment is possible for the current user.
        Specified by:
        assignedUser in interface Alarm
        Returns:
        the assigned user; always null in this release.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object