public class DataManager extends Object
Constructor and Description |
---|
DataManager()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
assetInfoChanged(long nodeid)
assetInfoChanged
|
Map<String,RTCCategory> |
getCategories()
getCategories
|
int |
getServiceCount(long nodeid,
String catLabel)
Get the service count for the nodeid in the context of the passed
category
|
int |
getServiceDownCount(long nodeid,
String catLabel)
Get the service down count for the nodeid in the context of the passed
category
|
double |
getValue(long nodeid,
String catLabel,
long curTime,
long rollingWindow)
Get the value(uptime) for the nodeid in the last 'rollingWindow' starting
at current time in the context of the passed category
|
double |
getValue(String catLabel,
long curTime,
long rollingWindow)
Get the value(uptime) for the category in the last 'rollingWindow'
starting at current time
|
void |
interfaceDown(long nodeid,
InetAddress ip,
long t)
Add a lost service entry to the right nodes.
|
void |
interfaceReparented(InetAddress ip,
long oldNodeId,
long newNodeId)
Reparent an interface.
|
void |
interfaceUp(long nodeid,
InetAddress ip,
long t)
Add a regained service entry to the right nodes.
|
void |
nodeCategoryMembershipChanged(long nodeid)
nodeCategoryMembershipChanged
|
void |
nodeDown(long nodeid,
long t)
Add a lost service entry to the right nodes.
|
void |
nodeGainedService(long nodeid,
InetAddress ip,
String svcName)
Handles a node gained service event.
|
void |
nodeLostService(long nodeid,
InetAddress ip,
String svcName,
long t)
Handles a node lost service event.
|
void |
nodeRegainedService(long nodeid,
InetAddress ip,
String svcName,
long t)
Add a regained service entry to the right node.
|
void |
nodeUp(long nodeid,
long t)
Add a regained service entry to the right nodes.
|
void |
rtcNodeRescan(long nodeid)
Update the categories for a node.
|
void |
serviceDeleted(long nodeid,
InetAddress ip,
String svcName)
Remove node from the map and the categories on a 'serviceDeleted' event.
|
public DataManager() throws SAXException, IOException, SQLException, FilterParseException, RTCException
SQLException
- if there is an error reading initial data from the
databaseFilterParseException
- if a rule in the categories.xml was incorrectRTCException
- if the initialization/data reading does not go throughSAXException
- if any.IOException
- if any.SQLException
- if any.FilterParseException
- if any.RTCException
- if any.public void nodeGainedService(long nodeid, InetAddress ip, String svcName)
nodeid
- the node idip
- the IP addresssvcName
- the service namepublic void nodeLostService(long nodeid, InetAddress ip, String svcName, long t)
nodeid
- the node idip
- the IP addresssvcName
- the service namet
- the time at which service was lostpublic void interfaceDown(long nodeid, InetAddress ip, long t)
nodeid
- the node idip
- the IP addresst
- the time at which service was lostpublic void nodeDown(long nodeid, long t)
nodeid
- the node idt
- the time at which service was lostpublic void nodeUp(long nodeid, long t)
nodeid
- the node idt
- the time at which service was regainedpublic void interfaceUp(long nodeid, InetAddress ip, long t)
nodeid
- the node idip
- the IP addresst
- the time at which service was regainedpublic void nodeRegainedService(long nodeid, InetAddress ip, String svcName, long t)
nodeid
- the node idip
- the IP addresssvcName
- the service namet
- the time at which service was regainedpublic void serviceDeleted(long nodeid, InetAddress ip, String svcName)
nodeid
- the nodeid on which service was deletedip
- the ip on which service was deletedsvcName
- the service that was deletedpublic void assetInfoChanged(long nodeid)
assetInfoChanged
nodeid
- a long.public void nodeCategoryMembershipChanged(long nodeid)
nodeCategoryMembershipChanged
nodeid
- a long.public void rtcNodeRescan(long nodeid) throws SQLException, FilterParseException, RTCException
nodeid
- the nodeid on which SNMP service was addedSQLException
- if the database read fails due to an SQL errorFilterParseException
- if filtering the data against the category rule fails due to
the rule being incorrectRTCException
- if the database read or filtering the data against the
category rule fails for some reasonpublic void interfaceReparented(InetAddress ip, long oldNodeId, long newNodeId)
ip
- the interface to reparentoldNodeId
- the node that the IP belonged to earliernewNodeId
- the node that the IP now belongs topublic double getValue(String catLabel, long curTime, long rollingWindow)
catLabel
- the category to which the node should belong tocurTime
- the current timerollingWindow
- the window for which value is to be calculatedpublic double getValue(long nodeid, String catLabel, long curTime, long rollingWindow)
nodeid
- the node for which value is to be calculatedcatLabel
- the category to which the node should belong tocurTime
- the current timerollingWindow
- the window for which value is to be calculatedpublic int getServiceCount(long nodeid, String catLabel)
nodeid
- the node for which service count is to be calculatedcatLabel
- the category to which the node should belong topublic int getServiceDownCount(long nodeid, String catLabel)
nodeid
- the node for which service down count is to be calculatedcatLabel
- the category to which the node should belong topublic Map<String,RTCCategory> getCategories()
getCategories
Copyright © 2020. All rights reserved.