Class RrdPersistOperationBuilder
- java.lang.Object
-
- org.opennms.netmgt.collection.persistence.rrd.RrdPersistOperationBuilder
-
- All Implemented Interfaces:
PersistOperationBuilder
public class RrdPersistOperationBuilder extends java.lang.Object implements PersistOperationBuilder
PersistOperationBuilder class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_DS_NAME_LENGTH
ConstantMAX_DS_NAME_LENGTH=19
-
Constructor Summary
Constructors Constructor Description RrdPersistOperationBuilder(RrdStrategy<?,?> rrdStrategy, RrdRepository repository, ResourceIdentifier resource, java.lang.String rrdName, boolean dontReorderAttributes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit()
commitvoid
declareAttribute(CollectionAttributeType attrType)
declareAttributejava.lang.String
getName()
getNameRrdRepository
getRepository()
getRepositoryRrdStrategy<?,?>
getRrdStrategy()
TimeKeeper
getTimeKeeper()
getTimeKeeperstatic RrdAttributeType
mapType(AttributeType type)
Static method which takes a MIB object type (counter, counter32, octetstring, etc...) and returns the appropriate RRD data type.static java.lang.String
mapValue(java.lang.Number num)
static java.lang.String
mapValue(java.lang.Number num, AttributeType type)
void
setAttributeMetadata(java.lang.String metricIdentifier, java.lang.String name)
void
setAttributeValue(CollectionAttributeType attrType, java.lang.Number value)
setAttributeValuevoid
setTimeKeeper(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, java.lang.String rrdName, boolean dontReorderAttributes)
-
-
Method Detail
-
getRrdStrategy
public RrdStrategy<?,?> getRrdStrategy()
-
getRepository
public RrdRepository getRepository()
getRepository
- Returns:
- a
RrdRepository
object.
-
declareAttribute
public void declareAttribute(CollectionAttributeType attrType)
declareAttribute
- Parameters:
attrType
- aCollectionAttributeType
object.
-
setAttributeValue
public void setAttributeValue(CollectionAttributeType attrType, java.lang.Number value)
setAttributeValue
- Specified by:
setAttributeValue
in interfacePersistOperationBuilder
- Parameters:
attrType
- aCollectionAttributeType
object.value
- aNumber
object.
-
setAttributeMetadata
public void setAttributeMetadata(java.lang.String metricIdentifier, java.lang.String name)
- Specified by:
setAttributeMetadata
in 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 java.lang.String mapValue(java.lang.Number num)
-
mapValue
public static java.lang.String mapValue(java.lang.Number num, AttributeType type)
-
commit
public void commit() throws PersistException
commit
- Specified by:
commit
in interfacePersistOperationBuilder
- Throws:
PersistException
- if any.
-
getName
public java.lang.String getName()
getName
- Specified by:
getName
in interfacePersistOperationBuilder
- Returns:
- a
String
object.
-
getTimeKeeper
public TimeKeeper getTimeKeeper()
getTimeKeeper
- Returns:
- a
TimeKeeper
object.
-
setTimeKeeper
public void setTimeKeeper(TimeKeeper timeKeeper)
setTimeKeeper
- Parameters:
timeKeeper
- aTimeKeeper
object.
-
-