Class SummaryDashlet

  • All Implemented Interfaces:
    Dashlet

    public class SummaryDashlet
    extends AbstractDashlet
    This class implements a Dashlet for testing purposes.
    Author:
    Christian Pape
    • Constructor Detail

      • SummaryDashlet

        public SummaryDashlet​(java.lang.String name,
                              DashletSpec dashletSpec,
                              AlarmDao alarmDao)
        Constructor for instantiating new objects.
        Parameters:
        dashletSpec - the DashletSpec to be used
    • Method Detail

      • getHumanReadableFormat

        public java.lang.String getHumanReadableFormat​(long secondsAll)
        Returns a human-readable String representation of a timestamp in the past.
        Parameters:
        secondsAll - the timestamp to be used
        Returns:
        a human-readable representation
      • countBySeverity

        public int countBySeverity​(boolean acknowledged,
                                   long age,
                                   OnmsSeverity onmsSeverity)
        Searches for alarms with the given criterias and returns the number found.
        Parameters:
        acknowledged - search for acknowledged or unacknowledged alarms
        age - the age of the alarms
        onmsSeverity - the OnmsSeverity to search for
        Returns:
        number of alarms found
      • countByUei

        public int countByUei​(boolean acknowledged,
                              long age,
                              java.lang.String uei)
        Searches for alarms with the given criterias and returns the number found.
        Parameters:
        acknowledged - search for acknowledged or unacknowledged alarms
        age - the age of the alarms
        uei - search for alarms with the specified uei
        Returns:
        number of alarms found