Class RrdPersistOperationBuilder
- java.lang.Object
-
- org.opennms.netmgt.collection.persistence.rrd.RrdPersistOperationBuilder
-
- All Implemented Interfaces:
PersistOperationBuilder
public class RrdPersistOperationBuilder extends Object implements PersistOperationBuilder
PersistOperationBuilder class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_DS_NAME_LENGTHConstantMAX_DS_NAME_LENGTH=19
-
Constructor Summary
Constructors Constructor Description RrdPersistOperationBuilder(RrdStrategy<?,?> rrdStrategy, RrdRepository repository, ResourceIdentifier resource, String rrdName, boolean dontReorderAttributes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()commitvoiddeclareAttribute(CollectionAttributeType attrType)declareAttributeStringgetName()getNameRrdRepositorygetRepository()getRepositoryRrdStrategy<?,?>getRrdStrategy()TimeKeepergetTimeKeeper()getTimeKeeperstatic RrdAttributeTypemapType(AttributeType type)Static method which takes a MIB object type (counter, counter32, octetstring, etc...) and returns the appropriate RRD data type.static StringmapValue(Number num)static StringmapValue(Number num, AttributeType type)voidsetAttributeMetadata(String metricIdentifier, String name)voidsetAttributeValue(CollectionAttributeType attrType, Number value)setAttributeValuevoidsetTimeKeeper(TimeKeeper timeKeeper)setTimeKeeper
-
-
-
Field Detail
-
MAX_DS_NAME_LENGTH
public static final int MAX_DS_NAME_LENGTH
ConstantMAX_DS_NAME_LENGTH=19- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RrdPersistOperationBuilder
public RrdPersistOperationBuilder(RrdStrategy<?,?> rrdStrategy, RrdRepository repository, ResourceIdentifier resource, String rrdName, boolean dontReorderAttributes)
-
-
Method Detail
-
getRrdStrategy
public RrdStrategy<?,?> getRrdStrategy()
-
getRepository
public RrdRepository getRepository()
getRepository
- Returns:
- a
RrdRepositoryobject.
-
declareAttribute
public void declareAttribute(CollectionAttributeType attrType)
declareAttribute
- Parameters:
attrType- aCollectionAttributeTypeobject.
-
setAttributeValue
public void setAttributeValue(CollectionAttributeType attrType, Number value)
setAttributeValue
- Specified by:
setAttributeValuein interfacePersistOperationBuilder- Parameters:
attrType- aCollectionAttributeTypeobject.value- aNumberobject.
-
setAttributeMetadata
public void setAttributeMetadata(String metricIdentifier, String name)
- Specified by:
setAttributeMetadatain interfacePersistOperationBuilder
-
mapType
public static RrdAttributeType mapType(AttributeType type)
Static method which takes a MIB object type (counter, counter32, octetstring, etc...) and returns the appropriate RRD data type. If the object type cannot be mapped to an RRD type, null is returned. RRD only supports integer data so MIB objects of type 'octetstring' are not supported.- Parameters:
type- - MIB object type to be mapped.- Returns:
- RRD type string or NULL object type is not supported.
-
mapValue
public static String mapValue(Number num, AttributeType type)
-
commit
public void commit() throws PersistExceptioncommit
- Specified by:
commitin interfacePersistOperationBuilder- Throws:
PersistException- if any.
-
getName
public String getName()
getName
- Specified by:
getNamein interfacePersistOperationBuilder- Returns:
- a
Stringobject.
-
getTimeKeeper
public TimeKeeper getTimeKeeper()
getTimeKeeper
- Returns:
- a
TimeKeeperobject.
-
setTimeKeeper
public void setTimeKeeper(TimeKeeper timeKeeper)
setTimeKeeper
- Parameters:
timeKeeper- aTimeKeeperobject.
-
-