Package org.opennms.reporting.datablock
Class Service
- java.lang.Object
-
- org.opennms.reporting.datablock.StandardNamedObject
-
- org.opennms.reporting.datablock.Service
-
public class Service extends StandardNamedObject
This class holds the service information and list of outages for the service.- Author:
- Jacinta Remedios
-
-
Constructor Summary
Constructors Constructor Description Service()Default Constructor.Service(String name)Constructor for Service.Service(String name, OutageSvcTimesList outages)Constructor that sets the name and the outages.Service(OutageSvcTimesList outages)Constructor that sets the outages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOutage(long lost)Added outage.voidaddOutage(long lost, long regained)Added outage.voidaddOutage(Outage outage)Adds a lost time / regained time combination for the node.booleanequals(Object obj)Equals method.longgetBusDownTime()Returns the outage time for this service during business hours.doublegetBusPercentAvail()Returns the percentage Availability for this service during business hours.doublegetDownTime()Returns the outage time for this service.longgetDownTime(long currentTime, long rollingWindow)Return the outage for this service.longgetMonitoredBusTime()Returns the monitored time for this service during business hours.longgetMonitoredTime()Returns the percentage Availability for this service during business hours.OutageSvcTimesListgetOutages()Return the outagesdoublegetPercentAvail()Returns the percentage Availability.doublegetPercentAvail(long currentTime, long rollingWindow)Returns the Percentage Availability for the service-
Methods inherited from class org.opennms.reporting.datablock.StandardNamedObject
getName, setName
-
-
-
-
Constructor Detail
-
Service
public Service()
Default Constructor.
-
Service
public Service(String name, OutageSvcTimesList outages)
Constructor that sets the name and the outages.- Parameters:
name- Name of the service.outages- Outages to be set for this service.
-
Service
public Service(OutageSvcTimesList outages)
Constructor that sets the outages.- Parameters:
outages- Outages for this service to be set.
-
-
Method Detail
-
getDownTime
public double getDownTime()
Returns the outage time for this service.- Returns:
- a double.
-
getBusDownTime
public long getBusDownTime()
Returns the outage time for this service during business hours.- Returns:
- a long.
-
getPercentAvail
public double getPercentAvail()
Returns the percentage Availability.- Returns:
- a double.
-
getBusPercentAvail
public double getBusPercentAvail()
Returns the percentage Availability for this service during business hours.- Returns:
- a double.
-
getMonitoredTime
public long getMonitoredTime()
Returns the percentage Availability for this service during business hours.- Returns:
- a long.
-
getMonitoredBusTime
public long getMonitoredBusTime()
Returns the monitored time for this service during business hours.- Returns:
- a long.
-
getOutages
public OutageSvcTimesList getOutages()
Return the outages- Returns:
- outages Outages to be set.
-
addOutage
public void addOutage(long lost, long regained)Added outage.- Parameters:
lost- a long.regained- a long.
-
addOutage
public void addOutage(long lost)
Added outage.- Parameters:
lost- a long.
-
addOutage
public void addOutage(Outage outage)
Adds a lost time / regained time combination for the node.- Parameters:
outage- aOutageobject.
-
getDownTime
public long getDownTime(long currentTime, long rollingWindow)Return the outage for this service.- Parameters:
currentTime- a long.rollingWindow- a long.- Returns:
- a long.
-
getPercentAvail
public double getPercentAvail(long currentTime, long rollingWindow)Returns the Percentage Availability for the service- Parameters:
currentTime- Time at the end of the Rolling Window.rollingWindow- Actual Monitored Time.- Returns:
- Percentage Availability
-
-