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 classSnmpCollectionSet.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 SnmpWalkercreateWalker()createWalkerprotected SnmpCollectionAgentgetAgent()SnmpAgentConfiggetAgentConfig()getAgentConfigSnmpCollectionAgentgetCollectionAgent()getCollectionAgentDategetCollectionTimestamp()Returns the timestamp of when this data collection was taken.CollectionTrackergetCollectionTracker()getCollectionTrackerprotected Collection<SnmpAttributeType>getGenericIndexAttributeTypes()getGenericIndexAttributeTypesSnmpIfCollectorgetIfCollector()getIfCollectorIfNumberTrackergetIfNumber()getIfNumberSnmpNodeCollectorgetNodeCollector()getNodeCollectorNodeInfogetNodeInfo()getNodeInfoCollection<? extends CollectionResource>getResources()getResourcesCollectionStatusgetStatus()SysUpTimeTrackergetSysUpTime()getSysUpTimebooleanignorePersist()ignorePersistvoidnotifyIfNotFound(CollectionAttributeType attrType, SnmpResult res)notifyIfNotFoundbooleanrescanNeeded()rescanNeededvoidsetCollectionTimestamp(Date m_timestamp)StringtoString()toStringvoidvisit(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- aCollectionAgentobject.snmpCollection- aOnmsSnmpCollectionobject.
-
-
Method Detail
-
toString
public String toString()
toString
-
getIfCollector
public SnmpIfCollector getIfCollector()
getIfCollector
- Returns:
- a
SnmpIfCollectorobject.
-
getIfNumber
public IfNumberTracker getIfNumber()
getIfNumber
- Returns:
- a
IfNumberTrackerobject.
-
getSysUpTime
public SysUpTimeTracker getSysUpTime()
getSysUpTime
- Returns:
- a
SysUpTimeTrackerobject.
-
getNodeCollector
public SnmpNodeCollector getNodeCollector()
getNodeCollector
- Returns:
- a
SnmpNodeCollectorobject.
-
getCollectionAgent
public SnmpCollectionAgent getCollectionAgent()
getCollectionAgent
- Returns:
- a
CollectionAgentobject.
-
getGenericIndexAttributeTypes
protected Collection<SnmpAttributeType> getGenericIndexAttributeTypes()
getGenericIndexAttributeTypes
- Returns:
- a
Collectionobject.
-
getCollectionTracker
public CollectionTracker getCollectionTracker()
getCollectionTracker
- Specified by:
getCollectionTrackerin interfaceCollectable- Returns:
- a
CollectionTrackerobject.
-
getResources
public Collection<? extends CollectionResource> getResources()
getResources
- Returns:
- a
Collectionobject.
-
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.
-
createWalker
protected SnmpWalker createWalker()
createWalker
- Returns:
- a
SnmpWalkerobject.
-
rescanNeeded
public boolean rescanNeeded()
rescanNeeded
- Returns:
- a boolean.
-
getAgentConfig
public SnmpAgentConfig getAgentConfig()
getAgentConfig
- Returns:
- a
SnmpAgentConfigobject.
-
notifyIfNotFound
public void notifyIfNotFound(CollectionAttributeType attrType, SnmpResult res)
notifyIfNotFound
- Parameters:
attrType- aCollectionAttributeTypeobject.res- aSnmpResultobject.
-
getStatus
public CollectionStatus getStatus()
- Specified by:
getStatusin interfaceCollectionSet
-
ignorePersist
public boolean ignorePersist()
ignorePersist
- Specified by:
ignorePersistin interfaceCollectionSet- Returns:
- a boolean.
-
getCollectionTimestamp
public Date getCollectionTimestamp()
Description copied from interface:CollectionSetReturns the timestamp of when this data collection was taken. Used by thresholding.- Specified by:
getCollectionTimestampin interfaceCollectionSet- Returns:
-
setCollectionTimestamp
public void setCollectionTimestamp(Date m_timestamp)
-
getAgent
protected SnmpCollectionAgent getAgent()
-
-