Package org.opennms.netmgt.rtc.datablock
Class RTCHashMap
- java.lang.Object
-
- org.opennms.netmgt.rtc.datablock.RTCHashMap
-
public class RTCHashMap extends Object
The RTCHashMap has either a nodeid or a nodeid/ip as key and provides convenience methods to add and remove 'RTCNodes' with these values - each key points to a list of 'RTCNode's- Author:
- Sowmya Kumaraswamy , OpenNMS.org
-
-
Constructor Summary
Constructors Constructor Description RTCHashMap(int initialCapacity)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(RTCNode rtcN)
Add an rtc nodevoid
delete(RTCNode rtcN)
deletevoid
deleteNode(int nodeid)
deleteNodeRTCNode
getRTCNode(RTCNodeKey key)
getRTCNodeList<RTCNode>
getRTCNodes(int nodeid)
getRTCNodesList<RTCNode>
getRTCNodes(int nodeid, InetAddress ip)
getRTCNodesint
getServiceCount(int nodeid, String catLabel)
Get the count of services for a node in the context of the the specified categoryint
getServiceDownCount(int nodeid, String catLabel)
Get the count of services currently down for a node in the context of the the specified categorydouble
getValue(int nodeid, String catLabel, long curTime, long rollingWindow)
Get the value (uptime) for the a node that belongs to the category in the last 'rollingWindow' starting at current timedouble
getValue(String catLabel, long curTime, long rollingWindow)
Get the value (uptime) for a category in the last 'rollingWindow' starting at current time
-
-
-
Method Detail
-
add
public void add(RTCNode rtcN)
Add an rtc node- Parameters:
rtcN
- the rtcNode to add
-
getValue
public double getValue(String catLabel, long curTime, long rollingWindow)
Get the value (uptime) for a category in the last 'rollingWindow' starting at current time- Parameters:
catLabel
- the category to which the node should belong tocurTime
- the current timerollingWindow
- the window for which value is to be calculated- Returns:
- the value(uptime) for the node
-
getValue
public double getValue(int nodeid, String catLabel, long curTime, long rollingWindow)
Get the value (uptime) for the a node that belongs to the category in the last 'rollingWindow' starting at current time- Parameters:
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 calculated- Returns:
- the value(uptime) for the node
-
getServiceCount
public int getServiceCount(int nodeid, String catLabel)
Get the count of services for a node in the context of the the specified category- Parameters:
nodeid
- the node for which servicecount is neededcatLabel
- the category to which the node should belong to- Returns:
- the service count for the nodeid in the context of the specfied category
-
getServiceDownCount
public int getServiceDownCount(int nodeid, String catLabel)
Get the count of services currently down for a node in the context of the the specified category- Parameters:
nodeid
- the node for which servicecount is neededcatLabel
- the category to which the node should belong to- Returns:
- the service down count for the nodeid in the context of the specfied category
-
getRTCNode
public RTCNode getRTCNode(RTCNodeKey key)
getRTCNode
- Parameters:
key
- aRTCNodeKey
object.- Returns:
- a
RTCNode
object.
-
getRTCNodes
public List<RTCNode> getRTCNodes(int nodeid)
getRTCNodes
- Parameters:
nodeid
- a long.- Returns:
- a
List
object.
-
getRTCNodes
public List<RTCNode> getRTCNodes(int nodeid, InetAddress ip)
getRTCNodes
-
deleteNode
public void deleteNode(int nodeid)
deleteNode
- Parameters:
nodeid
- a long.
-
-