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 CollectionAgent
getCollectionAgent()
getCollectionAgentprotected Collection<AttributeGroup>
getGroups()
getGroupsprotected AttributeGroupType
getGroupType(String groupName)
String
getOwnerName()
getOwnerNameResourceType
getResourceType()
getResourceTypeabstract 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.List<CollectionAttribute>
getStringAttributes()
TimeKeeper
getTimeKeeper()
Returns a not-nullTimeKeeper
instance when this resource requires to use a special timestamp when updating RRDs/JRBs.boolean
rescanNeeded()
rescanNeededvoid
setAttributeValue(SnmpAttributeType type, SnmpValue val)
setAttributeValueabstract boolean
shouldPersist(ServiceParameters params)
Determines whether the attribute should be persisted.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)-
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
- aResourceType
object.
-
-
Method Detail
-
getResourceType
public ResourceType getResourceType()
getResourceType
- Returns:
- a
ResourceType
object.
-
getCollectionAgent
public final CollectionAgent getCollectionAgent()
getCollectionAgent
- Returns:
- a
CollectionAgent
object.
-
shouldPersist
public abstract boolean shouldPersist(ServiceParameters params)
Determines whether the attribute should be persisted.- Specified by:
shouldPersist
in interfacePersistable
- Parameters:
params
- aServiceParameters
object.- Returns:
- a boolean.
-
getOwnerName
public String getOwnerName()
getOwnerName
- Specified by:
getOwnerName
in interfaceResourceIdentifier
- Returns:
- a
String
object.
-
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:
rescanNeeded
in interfaceCollectionResource
- Returns:
- a boolean.
-
setAttributeValue
public void setAttributeValue(SnmpAttributeType type, SnmpValue val)
setAttributeValue
- Parameters:
type
- aSnmpAttributeType
object.val
- aSnmpValue
object.
-
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:
visit
in interfaceCollectionVisitable
- Parameters:
visitor
- aCollectionSetVisitor
object.
-
getGroups
protected Collection<AttributeGroup> getGroups()
getGroups
- Returns:
- a
Collection
object.
-
getStringAttributes
public List<CollectionAttribute> getStringAttributes()
-
getTimeKeeper
public TimeKeeper getTimeKeeper()
Description copied from interface:CollectionResource
Returns a not-nullTimeKeeper
instance when this resource requires to use a special timestamp when updating RRDs/JRBs. If the resource doesn't need a specialTimeKeeper
it should return null.- Specified by:
getTimeKeeper
in interfaceCollectionResource
- Returns:
- a
TimeKeeper
object or null to indicate thatDefaultTimeKeeper
should be used.
-
-