org.opennms.netmgt.rtc.datablock
Class RTCHashMap

java.lang.Object
  extended by 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
RTCHashMap()
          Default constructor
RTCHashMap(int initialCapacity)
          constructor
RTCHashMap(int initialCapacity, float loadFactor)
          constructor
 
Method Summary
 void add(RTCNode rtcN)
          Add an rtc node
 void delete(RTCNode rtcN)
           
 void deleteNode(long nodeid)
           
 RTCNode getRTCNode(long nodeid, String ipaddr, String svcname)
           
 RTCNode getRTCNode(RTCNodeKey key)
           
 List getRTCNodes(long nodeid)
           
 List getRTCNodes(long nodeid, String ip)
           
 int getServiceCount(long nodeid, String catLabel)
          Get the count of services for a node in the context of the the specified category
 int getServiceDownCount(long nodeid, String catLabel)
          Get the count of services currently down for a node in the context of the the specified category
 double getValue(long 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
 double getValue(String catLabel, long curTime, long rollingWindow)
          Get the value (uptime) for a category in the last 'rollingWindow' starting at current time
 boolean isIpValidated(long nodeid, String ip, String catLabel)
          Check if this IP has already been validated for this category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTCHashMap

public RTCHashMap()
Default constructor


RTCHashMap

public RTCHashMap(int initialCapacity)
constructor


RTCHashMap

public RTCHashMap(int initialCapacity,
                  float loadFactor)
constructor

Method Detail

add

public void add(RTCNode rtcN)
Add an rtc node

Parameters:
rtcN - the rtcNode to add

delete

public void delete(RTCNode rtcN)

isIpValidated

public boolean isIpValidated(long nodeid,
                             String ip,
                             String catLabel)
Check if this IP has already been validated for this category

Parameters:
nodeid - the node id whose interface is to be validated
ip - the ip to be validated
catLabel - the category whose rule this ip is to pass
Returns:
true if ip has already been validated, false otherwise

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 to
curTime - the current time
rollingWindow - the window for which value is to be calculated
Returns:
the value(uptime) for the node

getValue

public double getValue(long 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 calculated
catLabel - the category to which the node should belong to
curTime - the current time
rollingWindow - the window for which value is to be calculated
Returns:
the value(uptime) for the node

getServiceCount

public int getServiceCount(long 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 needed
catLabel - 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(long 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 needed
catLabel - 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

public RTCNode getRTCNode(long nodeid,
                          String ipaddr,
                          String svcname)

getRTCNodes

public List getRTCNodes(long nodeid)

getRTCNodes

public List getRTCNodes(long nodeid,
                        String ip)

deleteNode

public void deleteNode(long nodeid)


Copyright © 2009. All Rights Reserved.