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 classCollectionResourceWrapper.CacheEntryKeeps 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 DoublegetAttributeValue(String ds)getAttributeValueStringgetDsLabel()getDsLabelStringgetFieldValue(String ds)getFieldValueStringgetHostAddress()getHostAddressStringgetIfIndex()getIfIndexprotected StringgetIfInfoValue(String attribute)getIfInfoValueStringgetIfLabel()getIfLabelStringgetInstance()getInstanceStringgetInstanceLabel()getInstanceLabelintgetNodeId()getNodeIdResourceIdgetResourceId()getResourceIdStringgetResourceTypeName()getResourceTypeNameLonggetSequenceNumber()StringgetServiceName()getServiceNamebooleanisAnInterfaceResource()isAnInterfaceResourcebooleanisLatencyResource()booleanisNodeResource()isNodeResourcebooleanisValidInterfaceResource()isValidInterfaceResourcevoidsetCounterReset(boolean counterReset)voidsetDsLabel(String dsLabel)setDsLabelStringtoString()
-
-
-
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- aStringobject.serviceName- aStringobject.repository- aRrdRepositoryobject.resource- aCollectionResourceobject.attributes- aMapobject.
-
-
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- aStringobject.
-
getResourceTypeName
public String getResourceTypeName()
getResourceTypeName
- Returns:
- a
Stringobject.
-
getResourceId
public ResourceId getResourceId()
getResourceId
Inspired by DefaultKscReportService
- Returns:
- a
Stringobject.
-
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()
-
-