|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.report.availability.AvailabilityData
AvailabilityData collects all the outages for all node/ip/service combination and stores it appropriately in the m_nodes structure.
Field Summary | |
private static long |
LAST_YEAR_ROLLING_WINDOW
Rolling window of the last year. |
private static java.lang.String |
LOG4J_CATEGORY
The log4j category used to log debug messsages and statements. |
private long |
m_12MonthsBack
End Time of the report. |
(package private) static java.sql.Connection |
m_availConn
Database connection handle. |
private java.lang.String |
m_catComment
Category Comments |
private java.lang.String |
m_categoryName
Category Name |
(package private) CategoryFactory |
m_catFactory
Category Factory |
private java.lang.String |
m_commonRule
Common Rule for the category group. |
private int |
m_daysInLastMonth
Number of days in the last month |
private long |
m_endTime
End Time of the report. |
private long |
m_lastMonthEndTime
End Time of the last month. |
private java.util.List |
m_nodes
List of Node objects that satisfy the filter rule for the category. |
private int |
m_sectionIndex
Section Index |
Constructor Summary | |
AvailabilityData(java.lang.String categoryName,
Report report,
java.lang.String format)
Constructor |
Method Summary | |
void |
addNode(java.lang.String nodeName,
int nodeid,
java.lang.String ipaddr,
java.lang.String serviceid,
long losttime,
long regainedtime)
This method adds a unique tuple to the list of nodes m_nodes. |
void |
closeConnection()
Closes the database connection. |
private static int |
getDays(boolean isLeap,
int month)
Returns the number of days in the month, also considers checks for leap year. |
private int |
getDaysForMonth(long endTime)
Returns the number of Days in the month |
java.util.List |
getNodes()
Returns the nodes. |
private void |
getOutagesNodeIpSvc(int nodeid,
java.lang.String nodeName,
java.lang.String ipaddr,
int serviceid,
java.lang.String serviceName,
OutageSvcTimesList outageSvcTimesList,
java.sql.PreparedStatement outagesGetStmt)
Get all outages for this nodeid/ipaddr/service combination and add it to m_nodes. |
java.util.TreeMap |
getPercentNode()
Returns percent/node combinations for the last month. |
void |
initialiseConnection()
Initialises the database connection. |
private void |
initialiseInterval()
Initialise the endTime, last Months end time and number of days in the last month. |
private void |
populateDataStructures(Category cat,
Report report,
java.lang.String format,
int catIndex)
Populates the data structure for this category. |
private void |
populateNodesFromDB(Category cat,
java.util.List monitoredServices)
For each category in the categories list, this reads the services and outage tables to get the initial data, creates objects that are added to the map and and to the appropriate category |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String LOG4J_CATEGORY
static java.sql.Connection m_availConn
private java.util.List m_nodes
private java.lang.String m_commonRule
private java.lang.String m_categoryName
private java.lang.String m_catComment
private long m_endTime
private long m_12MonthsBack
private long m_lastMonthEndTime
private int m_daysInLastMonth
CategoryFactory m_catFactory
private static long LAST_YEAR_ROLLING_WINDOW
private int m_sectionIndex
Constructor Detail |
public AvailabilityData(java.lang.String categoryName, Report report, java.lang.String format) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.lang.Exception
Method Detail |
private void populateDataStructures(Category cat, Report report, java.lang.String format, int catIndex) throws java.lang.Exception
cat
- Categoryreport
- Report Castor classformat
- SVG-specific/all reports
java.lang.Exception
private void initialiseInterval()
private static int getDays(boolean isLeap, int month)
isLeap
- the leap year flag.month
- The month whose days count is reqdprivate int getDaysForMonth(long endTime)
endTime
- The end of the month (time in milliseconds)public java.util.List getNodes()
public void initialiseConnection() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.lang.ClassNotFoundException, java.sql.SQLException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.lang.ClassNotFoundException
java.sql.SQLException
public void closeConnection()
public java.util.TreeMap getPercentNode()
private void populateNodesFromDB(Category cat, java.util.List monitoredServices) throws java.sql.SQLException, FilterParseException, java.lang.Exception
java.sql.SQLException
- if the database read fails due to an SQL error
FilterParseException
- if filtering the data against the category rule fails due to
the rule being incorrect
java.lang.Exception
private void getOutagesNodeIpSvc(int nodeid, java.lang.String nodeName, java.lang.String ipaddr, int serviceid, java.lang.String serviceName, OutageSvcTimesList outageSvcTimesList, java.sql.PreparedStatement outagesGetStmt) throws java.sql.SQLException
java.sql.SQLException
public void addNode(java.lang.String nodeName, int nodeid, java.lang.String ipaddr, java.lang.String serviceid, long losttime, long regainedtime)
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |