Package org.opennms.netmgt.collectd
Class SnmpCollectionSet
- java.lang.Object
-
- org.opennms.netmgt.collectd.SnmpCollectionSet
-
- All Implemented Interfaces:
CollectionSet
,CollectionVisitable
,Collectable
public class SnmpCollectionSet extends Object implements Collectable, CollectionSet
SnmpCollectionSet class.
After creation, be sure to call setCollectionTimestamp with the time the collection is taken It is inappropriate to require it in the constructor, as instances may be created independently and at a different time from when the data is collected. (They're not currently, but it's better not to make assumptions)- Version:
- $Id: $
- Author:
- ranger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnmpCollectionSet.RescanNeeded
-
Constructor Summary
Constructors Constructor Description SnmpCollectionSet(SnmpCollectionAgent agent, OnmsSnmpCollection snmpCollection, LocationAwareSnmpClient client)
Constructor for SnmpCollectionSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SnmpWalker
createWalker()
createWalkerprotected SnmpCollectionAgent
getAgent()
SnmpAgentConfig
getAgentConfig()
getAgentConfigSnmpCollectionAgent
getCollectionAgent()
getCollectionAgentDate
getCollectionTimestamp()
Returns the timestamp of when this data collection was taken.CollectionTracker
getCollectionTracker()
getCollectionTrackerprotected Collection<SnmpAttributeType>
getGenericIndexAttributeTypes()
getGenericIndexAttributeTypesSnmpIfCollector
getIfCollector()
getIfCollectorIfNumberTracker
getIfNumber()
getIfNumberSnmpNodeCollector
getNodeCollector()
getNodeCollectorNodeInfo
getNodeInfo()
getNodeInfoCollection<? extends CollectionResource>
getResources()
getResourcesCollectionStatus
getStatus()
SysUpTimeTracker
getSysUpTime()
getSysUpTimeboolean
ignorePersist()
ignorePersistvoid
notifyIfNotFound(CollectionAttributeType attrType, SnmpResult res)
notifyIfNotFoundboolean
rescanNeeded()
rescanNeededvoid
setCollectionTimestamp(Date m_timestamp)
String
toString()
toStringvoid
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, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.collection.api.CollectionSet
getSequenceNumber
-
-
-
-
Constructor Detail
-
SnmpCollectionSet
public SnmpCollectionSet(SnmpCollectionAgent agent, OnmsSnmpCollection snmpCollection, LocationAwareSnmpClient client)
Constructor for SnmpCollectionSet.
- Parameters:
agent
- aCollectionAgent
object.snmpCollection
- aOnmsSnmpCollection
object.
-
-
Method Detail
-
toString
public String toString()
toString
-
getIfCollector
public SnmpIfCollector getIfCollector()
getIfCollector
- Returns:
- a
SnmpIfCollector
object.
-
getIfNumber
public IfNumberTracker getIfNumber()
getIfNumber
- Returns:
- a
IfNumberTracker
object.
-
getSysUpTime
public SysUpTimeTracker getSysUpTime()
getSysUpTime
- Returns:
- a
SysUpTimeTracker
object.
-
getNodeCollector
public SnmpNodeCollector getNodeCollector()
getNodeCollector
- Returns:
- a
SnmpNodeCollector
object.
-
getCollectionAgent
public SnmpCollectionAgent getCollectionAgent()
getCollectionAgent
- Returns:
- a
CollectionAgent
object.
-
getGenericIndexAttributeTypes
protected Collection<SnmpAttributeType> getGenericIndexAttributeTypes()
getGenericIndexAttributeTypes
- Returns:
- a
Collection
object.
-
getCollectionTracker
public CollectionTracker getCollectionTracker()
getCollectionTracker
- Specified by:
getCollectionTracker
in interfaceCollectable
- Returns:
- a
CollectionTracker
object.
-
getResources
public Collection<? extends CollectionResource> getResources()
getResources
- Returns:
- a
Collection
object.
-
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.
-
createWalker
protected SnmpWalker createWalker()
createWalker
- Returns:
- a
SnmpWalker
object.
-
rescanNeeded
public boolean rescanNeeded()
rescanNeeded
- Returns:
- a boolean.
-
getAgentConfig
public SnmpAgentConfig getAgentConfig()
getAgentConfig
- Returns:
- a
SnmpAgentConfig
object.
-
notifyIfNotFound
public void notifyIfNotFound(CollectionAttributeType attrType, SnmpResult res)
notifyIfNotFound
- Parameters:
attrType
- aCollectionAttributeType
object.res
- aSnmpResult
object.
-
getStatus
public CollectionStatus getStatus()
- Specified by:
getStatus
in interfaceCollectionSet
-
ignorePersist
public boolean ignorePersist()
ignorePersist
- Specified by:
ignorePersist
in interfaceCollectionSet
- Returns:
- a boolean.
-
getCollectionTimestamp
public Date getCollectionTimestamp()
Description copied from interface:CollectionSet
Returns the timestamp of when this data collection was taken. Used by thresholding.- Specified by:
getCollectionTimestamp
in interfaceCollectionSet
- Returns:
-
setCollectionTimestamp
public void setCollectionTimestamp(Date m_timestamp)
-
getAgent
protected SnmpCollectionAgent getAgent()
-
-