Package org.opennms.netmgt.collectd
Class SnmpCollectionResource
- java.lang.Object
-
- org.opennms.netmgt.collectd.SnmpCollectionResource
-
- All Implemented Interfaces:
CollectionResource,CollectionVisitable,Persistable,ResourceIdentifier
- Direct Known Subclasses:
AliasedResource,GenericIndexResource,IfInfo,NodeInfo
public abstract class SnmpCollectionResource extends Object implements CollectionResource
Abstract SnmpCollectionResource class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
-
Fields inherited from interface org.opennms.netmgt.collection.api.CollectionResource
RESOURCE_TYPE_IF, RESOURCE_TYPE_LATENCY, RESOURCE_TYPE_NODE
-
-
Constructor Summary
Constructors Constructor Description SnmpCollectionResource(ResourceType def)Constructor for SnmpCollectionResource.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CollectionAgentgetCollectionAgent()getCollectionAgentprotected Collection<AttributeGroup>getGroups()getGroupsprotected AttributeGroupTypegetGroupType(String groupName)StringgetOwnerName()getOwnerNameResourceTypegetResourceType()getResourceTypeabstract intgetSnmpIfType()Returns ifType; is (but not sure if it should be) -1 for non interface type collections, otherwise the SNMP type of the interface.List<CollectionAttribute>getStringAttributes()TimeKeepergetTimeKeeper()Returns a not-nullTimeKeeperinstance when this resource requires to use a special timestamp when updating RRDs/JRBs.booleanrescanNeeded()rescanNeededvoidsetAttributeValue(SnmpAttributeType type, SnmpValue val)setAttributeValueabstract booleanshouldPersist(ServiceParameters params)Determines whether the attribute should be persisted.voidvisit(CollectionSetVisitor visitor)Provide a way to visit all the values in the CollectionSet, for any appropriate purposes (persisting, thresholding, or others) The expectation is that calling this method will ultimately call visitResource, visitGroup and visitAttribute (as appropriate)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.collection.api.CollectionResource
getInstance, getInterfaceLabel, getParent, getResourceTypeName, getUnmodifiedInstance
-
Methods inherited from interface org.opennms.netmgt.collection.api.ResourceIdentifier
getPath
-
-
-
-
Constructor Detail
-
SnmpCollectionResource
public SnmpCollectionResource(ResourceType def)
Constructor for SnmpCollectionResource.
- Parameters:
def- aResourceTypeobject.
-
-
Method Detail
-
getResourceType
public ResourceType getResourceType()
getResourceType
- Returns:
- a
ResourceTypeobject.
-
getCollectionAgent
public final CollectionAgent getCollectionAgent()
getCollectionAgent
- Returns:
- a
CollectionAgentobject.
-
shouldPersist
public abstract boolean shouldPersist(ServiceParameters params)
Determines whether the attribute should be persisted.- Specified by:
shouldPersistin interfacePersistable- Parameters:
params- aServiceParametersobject.- Returns:
- a boolean.
-
getOwnerName
public String getOwnerName()
getOwnerName
- Specified by:
getOwnerNamein interfaceResourceIdentifier- Returns:
- a
Stringobject.
-
getSnmpIfType
public abstract int getSnmpIfType()
Returns ifType; is (but not sure if it should be) -1 for non interface type collections, otherwise the SNMP type of the interface. This field is used to match the ifType field of the group from datacollection-config.xml.- Returns:
- a int.
-
rescanNeeded
public boolean rescanNeeded()
rescanNeeded
- Specified by:
rescanNeededin interfaceCollectionResource- Returns:
- a boolean.
-
setAttributeValue
public void setAttributeValue(SnmpAttributeType type, SnmpValue val)
setAttributeValue
- Parameters:
type- aSnmpAttributeTypeobject.val- aSnmpValueobject.
-
getGroupType
protected AttributeGroupType getGroupType(String groupName)
-
visit
public void visit(CollectionSetVisitor visitor)
Provide a way to visit all the values in the CollectionSet, for any appropriate purposes (persisting, thresholding, or others) The expectation is that calling this method will ultimately call visitResource, visitGroup and visitAttribute (as appropriate)- Specified by:
visitin interfaceCollectionVisitable- Parameters:
visitor- aCollectionSetVisitorobject.
-
getGroups
protected Collection<AttributeGroup> getGroups()
getGroups
- Returns:
- a
Collectionobject.
-
getStringAttributes
public List<CollectionAttribute> getStringAttributes()
-
getTimeKeeper
public TimeKeeper getTimeKeeper()
Description copied from interface:CollectionResourceReturns a not-nullTimeKeeperinstance when this resource requires to use a special timestamp when updating RRDs/JRBs. If the resource doesn't need a specialTimeKeeperit should return null.- Specified by:
getTimeKeeperin interfaceCollectionResource- Returns:
- a
TimeKeeperobject or null to indicate thatDefaultTimeKeepershould be used.
-
-