Package org.opennms.netmgt.threshd
Class CollectionResourceWrapper
- java.lang.Object
-
- org.opennms.netmgt.threshd.CollectionResourceWrapper
-
public class CollectionResourceWrapper extends java.lang.Object
CollectionResourceWrapper class.
Wraps a CollectionResource with some methods and caching for the efficient application of thresholds (without pulling thresholding code into CollectionResource itself) A fresh instance should be created for each collection cycle (assumptions are made based on that premise)- Version:
- $Id: $
- Author:
- ranger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CollectionResourceWrapper.CacheEntry
Keeps track of both the Double value, and when it was collected, for the static cache of attributes This is necessary for the *correct* calculation of Counter rates, across variable collection times and possible collection failures (see NMS-4244)
-
Constructor Summary
Constructors Constructor Description CollectionResourceWrapper(java.util.Date collectionTimestamp, int nodeId, java.lang.String hostAddress, java.lang.String serviceName, RrdRepository repository, CollectionResource resource, java.util.Map<java.lang.String,CollectionAttribute> attributes, ResourceStorageDao resourceStorageDao, IfLabel ifLabelDao, java.lang.Long sequenceNumber)
Constructor for CollectionResourceWrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Double
getAttributeValue(java.lang.String ds)
getAttributeValuejava.lang.String
getDsLabel()
getDsLabeljava.lang.String
getFieldValue(java.lang.String ds)
getFieldValuejava.lang.String
getHostAddress()
getHostAddressjava.lang.String
getIfIndex()
getIfIndexprotected java.lang.String
getIfInfoValue(java.lang.String attribute)
getIfInfoValuejava.lang.String
getIfLabel()
getIfLabeljava.lang.String
getInstance()
getInstancejava.lang.String
getInstanceLabel()
getInstanceLabelint
getNodeId()
getNodeIdResourceId
getResourceId()
getResourceIdjava.lang.String
getResourceTypeName()
getResourceTypeNamejava.lang.Long
getSequenceNumber()
java.lang.String
getServiceName()
getServiceNameboolean
isAnInterfaceResource()
isAnInterfaceResourceboolean
isLatencyResource()
boolean
isNodeResource()
isNodeResourceboolean
isValidInterfaceResource()
isValidInterfaceResourcevoid
setCounterReset(boolean counterReset)
void
setDsLabel(java.lang.String dsLabel)
setDsLabeljava.lang.String
toString()
-
-
-
Constructor Detail
-
CollectionResourceWrapper
public CollectionResourceWrapper(java.util.Date collectionTimestamp, int nodeId, java.lang.String hostAddress, java.lang.String serviceName, RrdRepository repository, CollectionResource resource, java.util.Map<java.lang.String,CollectionAttribute> attributes, ResourceStorageDao resourceStorageDao, IfLabel ifLabelDao, java.lang.Long sequenceNumber)
Constructor for CollectionResourceWrapper.
- Parameters:
interval
- a long.nodeId
- a int.hostAddress
- aString
object.serviceName
- aString
object.repository
- aRrdRepository
object.resource
- aCollectionResource
object.attributes
- aMap
object.
-
-
Method Detail
-
setCounterReset
public void setCounterReset(boolean counterReset)
-
getNodeId
public int getNodeId()
getNodeId
- Returns:
- a int.
-
getHostAddress
public java.lang.String getHostAddress()
getHostAddress
- Returns:
- a
String
object.
-
getServiceName
public java.lang.String getServiceName()
getServiceName
- Returns:
- a
String
object.
-
getDsLabel
public java.lang.String getDsLabel()
getDsLabel
- Returns:
- a
String
object.
-
setDsLabel
public void setDsLabel(java.lang.String dsLabel)
setDsLabel
- Parameters:
dsLabel
- aString
object.
-
getInstance
public java.lang.String getInstance()
getInstance
- Returns:
- a
String
object.
-
getInstanceLabel
public java.lang.String getInstanceLabel()
getInstanceLabel
- Returns:
- a
String
object.
-
getResourceTypeName
public java.lang.String getResourceTypeName()
getResourceTypeName
- Returns:
- a
String
object.
-
getResourceId
public ResourceId getResourceId()
getResourceId
Inspired by DefaultKscReportService
- Returns:
- a
String
object.
-
getIfLabel
public java.lang.String getIfLabel()
getIfLabel
- Returns:
- a
String
object.
-
getIfIndex
public java.lang.String getIfIndex()
getIfIndex
- Returns:
- a
String
object.
-
getIfInfoValue
protected java.lang.String getIfInfoValue(java.lang.String attribute)
getIfInfoValue
- Parameters:
attribute
- aString
object.- Returns:
- a
String
object.
-
isLatencyResource
public boolean isLatencyResource()
-
isNodeResource
public boolean isNodeResource()
isNodeResource
- Returns:
- a boolean.
-
isAnInterfaceResource
public boolean isAnInterfaceResource()
isAnInterfaceResource
- Returns:
- a boolean.
-
isValidInterfaceResource
public boolean isValidInterfaceResource()
isValidInterfaceResource
- Returns:
- a boolean.
-
getAttributeValue
public java.lang.Double getAttributeValue(java.lang.String ds)
getAttributeValue
- Parameters:
ds
- aString
object.- Returns:
- a
Double
object.
-
getFieldValue
public java.lang.String getFieldValue(java.lang.String ds)
getFieldValue
- Parameters:
ds
- aString
object.- Returns:
- a
String
object.
-
getSequenceNumber
public java.lang.Long getSequenceNumber()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-