Package org.opennms.netmgt.threshd
Class CollectionResourceWrapper
- java.lang.Object
-
- org.opennms.netmgt.threshd.CollectionResourceWrapper
-
public class CollectionResourceWrapper extends 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(Date collectionTimestamp, int nodeId, String hostAddress, String serviceName, RrdRepository repository, CollectionResource resource, Map<String,CollectionAttribute> attributes, ResourceStorageDao resourceStorageDao, IfLabel ifLabelDao, Long sequenceNumber)
Constructor for CollectionResourceWrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
getAttributeValue(String ds)
getAttributeValueString
getDsLabel()
getDsLabelString
getFieldValue(String ds)
getFieldValueString
getHostAddress()
getHostAddressString
getIfIndex()
getIfIndexprotected String
getIfInfoValue(String attribute)
getIfInfoValueString
getIfLabel()
getIfLabelString
getInstance()
getInstanceString
getInstanceLabel()
getInstanceLabelint
getNodeId()
getNodeIdResourceId
getResourceId()
getResourceIdString
getResourceTypeName()
getResourceTypeNameLong
getSequenceNumber()
String
getServiceName()
getServiceNameboolean
isAnInterfaceResource()
isAnInterfaceResourceboolean
isLatencyResource()
boolean
isNodeResource()
isNodeResourceboolean
isValidInterfaceResource()
isValidInterfaceResourcevoid
setCounterReset(boolean counterReset)
void
setDsLabel(String dsLabel)
setDsLabelString
toString()
-
-
-
Constructor Detail
-
CollectionResourceWrapper
public CollectionResourceWrapper(Date collectionTimestamp, int nodeId, String hostAddress, String serviceName, RrdRepository repository, CollectionResource resource, Map<String,CollectionAttribute> attributes, ResourceStorageDao resourceStorageDao, IfLabel ifLabelDao, 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.
-
setDsLabel
public void setDsLabel(String dsLabel)
setDsLabel
- Parameters:
dsLabel
- aString
object.
-
getResourceTypeName
public String getResourceTypeName()
getResourceTypeName
- Returns:
- a
String
object.
-
getResourceId
public ResourceId getResourceId()
getResourceId
Inspired by DefaultKscReportService
- 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.
-
getSequenceNumber
public Long getSequenceNumber()
-
-