OpenNMS API 1.2.9

## org.opennms.netmgt.rtc.datablock
Class RTCHashMap

    java.lang.Object
      java.util.AbstractMap
          java.util.HashMap
              org.opennms.netmgt.rtc.datablock.RTCHashMap

All Implemented Interfaces:
  java.lang.Cloneable, java.util.Map, java.io.Serializable

public class RTCHashMap
extends java.util.HashMap

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
See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class java.util.HashMap
``

Nested classes inherited from class java.util.AbstractMap
``

Field Summary

Fields inherited from class java.util.HashMap
``

Fields inherited from class java.util.AbstractMap
``

Constructor Summary
`RTCHashMap()` Default constructor
`RTCHashMap(int initialCapacity)` constructor
`RTCHashMap(int initialCapacity, float loadFactor)` constructor

Method Summary
`void` `add(long nodeid, RTCNode rtcN)` Add the node with nodeid as key
`void` `add(long nodeid, java.lang.String ip, RTCNode rtcN)` Add the rtc node with nodeid and ip as key
`void` `delete(long nodeid, RTCNode rtcN)` Delete the node from list with nodeid as key
`void` `delete(long nodeid, java.lang.String ip, RTCNode rtcN)` Delete the rtc node from list with nodeid and ip as key
`int` `getServiceCount(long nodeid, java.lang.String catLabel)` Get the count of services for a node in the context of the the specified category
`int` `getServiceDownCount(long nodeid, java.lang.String catLabel)` Get the count of services currently down for a node in the context of the the specified category
`double` `getValue(long nodeid, java.lang.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(java.lang.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, java.lang.String ip, java.lang.String catLabel)` Check if this IP has already been validated for this category

Methods inherited from class java.util.HashMap
`clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values`

Methods inherited from class java.util.AbstractMap
`equals, hashCode, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Map
`equals, hashCode`

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(long nodeid,
                    RTCNode rtcN)

  Add the node with nodeid as key

  Parameters:
    `nodeid` - the nodeid
    `rtcN` - the RTCNode to add

### add

    public void add(long nodeid,
                    java.lang.String ip,
                    RTCNode rtcN)

  Add the rtc node with nodeid and ip as key

  Parameters:
    `nodeid` - the nodeid
    `ip` - the ip
    `rtcN` - the RTCNode to add

### delete

    public void delete(long nodeid,
                       RTCNode rtcN)

  Delete the node from list with nodeid as key

  Parameters:
    `nodeid` - the nodeid
    `rtcN` - the RTCNode to delete

### delete

    public void delete(long nodeid,
                       java.lang.String ip,
                       RTCNode rtcN)

  Delete the rtc node from list with nodeid and ip as key

  Parameters:
    `nodeid` - the nodeid
    `ip` - the ip
    `rtcN` - the RTCNode to add

### isIpValidated

    public boolean isIpValidated(long nodeid,
                                 java.lang.String ip,
                                 java.lang.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(java.lang.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,
                           java.lang.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,
                               java.lang.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,
                                   java.lang.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

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.