Class SummaryDashlet
- java.lang.Object
-
- org.opennms.features.vaadin.dashboard.model.AbstractDashlet
-
- org.opennms.features.vaadin.dashboard.dashlets.SummaryDashlet
-
- All Implemented Interfaces:
Dashlet
public class SummaryDashlet extends AbstractDashlet
This class implements aDashlet
for testing purposes.- Author:
- Christian Pape
-
-
Constructor Summary
Constructors Constructor Description SummaryDashlet(java.lang.String name, DashletSpec dashletSpec, AlarmDao alarmDao)
Constructor for instantiating new objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countBySeverity(boolean acknowledged, long age, OnmsSeverity onmsSeverity)
Searches for alarms with the given criterias and returns the number found.int
countByUei(boolean acknowledged, long age, java.lang.String uei)
Searches for alarms with the given criterias and returns the number found.DashletComponent
getDashboardComponent(com.vaadin.ui.UI ui)
java.lang.String
getHumanReadableFormat(long secondsAll)
Returns a human-readableString
representation of a timestamp in the past.DashletComponent
getWallboardComponent(com.vaadin.ui.UI ui)
Updates the dashlet contents and computes new boosted state-
Methods inherited from class org.opennms.features.vaadin.dashboard.model.AbstractDashlet
getDashletSpec, getName, isBoosted, setDashletSpec, setName
-
-
-
-
Constructor Detail
-
SummaryDashlet
public SummaryDashlet(java.lang.String name, DashletSpec dashletSpec, AlarmDao alarmDao)
Constructor for instantiating new objects.- Parameters:
dashletSpec
- theDashletSpec
to be used
-
-
Method Detail
-
getHumanReadableFormat
public java.lang.String getHumanReadableFormat(long secondsAll)
Returns a human-readableString
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 alarmsage
- the age of the alarmsonmsSeverity
- theOnmsSeverity
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 alarmsage
- the age of the alarmsuei
- search for alarms with the specified uei- Returns:
- number of alarms found
-
getWallboardComponent
public DashletComponent getWallboardComponent(com.vaadin.ui.UI ui)
Description copied from interface:Dashlet
Updates the dashlet contents and computes new boosted state- Specified by:
getWallboardComponent
in interfaceDashlet
- Overrides:
getWallboardComponent
in classAbstractDashlet
- Parameters:
ui
- TheUI
which holds the component.
-
getDashboardComponent
public DashletComponent getDashboardComponent(com.vaadin.ui.UI ui)
- Specified by:
getDashboardComponent
in interfaceDashlet
- Overrides:
getDashboardComponent
in classAbstractDashlet
-
-