org.opennms.netmgt.linkd
Class SnmpCollection

java.lang.Object
  extended by org.opennms.netmgt.linkd.SnmpCollection
All Implemented Interfaces:
Runnable, ReadyRunnable

public final class SnmpCollection
extends Object
implements ReadyRunnable

This class is designed to collect the necessary SNMP information from the target address and store the collected information. When the class is initially constructed no information is collected. The SNMP Session creating and colletion occurs in the main run method of the instance. This allows the collection to occur in a thread if necessary.

Author:
Weave , OpenNMS

Field Summary
static int DEFAULT_VLAN_INDEX
          The vlan string to define default vlan index
static String DEFAULT_VLAN_NAME
          The vlan string to define default vlan name
 CdpCacheTable m_CdpCache
          The CdpCache table information
 IpNetToMediaTable m_ipNetToMedia
          The ipnettomedia table information
 IpRouteTable m_ipRoute
          The ipRoute table information
 Map<Vlan,org.opennms.netmgt.linkd.SnmpVlanCollection> m_snmpVlanCollection
          The list of vlan snmp collection object
 SnmpTable m_vlanTable
          The Vlan Table information
static int TRUNK_VLAN_INDEX
          The vlan string to define vlan index when collection is made for all vlan
static String TRUNK_VLAN_NAME
          The vlan string to define vlan name when collection is made for all vlan
 
Constructor Summary
SnmpCollection(SnmpAgentConfig config)
          Constructs a new snmp collector for a node using the passed interface as the collection point.
 
Method Summary
 void collectBridgeForwardingTable(boolean bridgeForwardingTable)
           
 void collectCdpTable(boolean cdpTable)
           
 void collectIpRouteTable(boolean ipRouteTable)
           
 void collectStpNode(boolean stpNode)
           
 void collectStpTable(boolean stpTable)
           
 boolean collectVlanTable()
           
 boolean equals(ReadyRunnable run)
           
 boolean getCollectBridgeForwardingTable()
           
 boolean getCollectCdpTable()
           
 boolean getCollectIpRouteTable()
           
 boolean getCollectStpNode()
           
 boolean getCollectStpTable()
           
 String getInfo()
           
 long getInitialSleepTime()
           
 String getPackageName()
           
 SnmpAgentConfig getPeer()
           
 long getPollInterval()
           
 int getPort()
           
 String getReadCommunity()
           
 boolean getSaveIpRouteTable()
           
 boolean getSaveStpInterfaceTable()
           
 boolean getSaveStpNodeTable()
           
 Scheduler getScheduler()
           
 InetAddress getTarget()
          Returns the target address that the collection occured for.
 String getVlanClass()
           
 int getVlanIndex(String m_vlanname)
          Returns the VLAN vlanindex from name.
 String getVlanName(int m_vlan)
          Returns the VLAN name from vlanindex.
 boolean isReady()
          Returns true if the runnable is ready to start.
 boolean isSuspended()
           
 void run()
           Performs the collection for the targeted internet address.
 void SaveIpRouteTable(boolean ipRouteTable)
           
 void saveStpInterfaceTable(boolean stpInterfaceTable)
           
 void saveStpNodeTable(boolean stpNodeTable)
           
 void schedule()
           
 void setInitialSleepTime(long initial_sleep_time)
           
 void setPackageName(String packageName)
           
 void setPollInterval(long interval)
           
 void setScheduler(Scheduler scheduler)
           
 void setVlanClass(String className)
           
 void suspend()
           
 void unschedule()
           
 void wakeUp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRUNK_VLAN_NAME

public static final String TRUNK_VLAN_NAME
The vlan string to define vlan name when collection is made for all vlan

See Also:
Constant Field Values

TRUNK_VLAN_INDEX

public static final int TRUNK_VLAN_INDEX
The vlan string to define vlan index when collection is made for all vlan

See Also:
Constant Field Values

DEFAULT_VLAN_NAME

public static final String DEFAULT_VLAN_NAME
The vlan string to define default vlan name

See Also:
Constant Field Values

DEFAULT_VLAN_INDEX

public static final int DEFAULT_VLAN_INDEX
The vlan string to define default vlan index

See Also:
Constant Field Values

m_ipNetToMedia

public IpNetToMediaTable m_ipNetToMedia
The ipnettomedia table information


m_ipRoute

public IpRouteTable m_ipRoute
The ipRoute table information


m_CdpCache

public CdpCacheTable m_CdpCache
The CdpCache table information


m_vlanTable

public SnmpTable m_vlanTable
The Vlan Table information


m_snmpVlanCollection

public Map<Vlan,org.opennms.netmgt.linkd.SnmpVlanCollection> m_snmpVlanCollection
The list of vlan snmp collection object

Constructor Detail

SnmpCollection

public SnmpCollection(SnmpAgentConfig config)
Constructs a new snmp collector for a node using the passed interface as the collection point. The collection does not occur until the run method is invoked.

Parameters:
config - The SnmpPeer object to collect from.
Method Detail

getVlanName

public String getVlanName(int m_vlan)
Returns the VLAN name from vlanindex.


getVlanIndex

public int getVlanIndex(String m_vlanname)
Returns the VLAN vlanindex from name.


run

public void run()

Performs the collection for the targeted internet address. The success or failure of the collection should be tested via the failed method.

No synchronization is performed, so if this is used in a separate thread context synchornization must be added.

Specified by:
run in interface Runnable

getScheduler

public Scheduler getScheduler()

setScheduler

public void setScheduler(Scheduler scheduler)

getInitialSleepTime

public long getInitialSleepTime()
Returns:
Returns the initial_sleep_time.

setInitialSleepTime

public void setInitialSleepTime(long initial_sleep_time)
Parameters:
initial_sleep_time - The initial_sleep_timeto set.

getPollInterval

public long getPollInterval()
Returns:
Returns the initial_sleep_time.

setPollInterval

public void setPollInterval(long interval)
Parameters:
initial_sleep_time - The initial_sleep_timeto set.

schedule

public void schedule()
Specified by:
schedule in interface ReadyRunnable

isReady

public boolean isReady()
Description copied from interface: ReadyRunnable
Returns true if the runnable is ready to start.

Specified by:
isReady in interface ReadyRunnable

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface ReadyRunnable
Returns:
Returns the suspendCollection.

suspend

public void suspend()
Specified by:
suspend in interface ReadyRunnable
Parameters:
suspendCollection - The suspendCollection to set.

wakeUp

public void wakeUp()
Specified by:
wakeUp in interface ReadyRunnable
Parameters:
suspendCollection - The suspendCollection to set.

unschedule

public void unschedule()
Specified by:
unschedule in interface ReadyRunnable

getVlanClass

public String getVlanClass()
Returns:
Returns the m_vlanClass.

setVlanClass

public void setVlanClass(String className)

getTarget

public InetAddress getTarget()
Returns the target address that the collection occured for.


collectVlanTable

public boolean collectVlanTable()
Returns:
Returns the m_collectVlanTable.

getReadCommunity

public String getReadCommunity()

getPeer

public SnmpAgentConfig getPeer()

getPort

public int getPort()

equals

public boolean equals(ReadyRunnable run)
Specified by:
equals in interface ReadyRunnable

getInfo

public String getInfo()
Specified by:
getInfo in interface ReadyRunnable

getCollectBridgeForwardingTable

public boolean getCollectBridgeForwardingTable()

collectBridgeForwardingTable

public void collectBridgeForwardingTable(boolean bridgeForwardingTable)

getCollectCdpTable

public boolean getCollectCdpTable()

collectCdpTable

public void collectCdpTable(boolean cdpTable)

getCollectIpRouteTable

public boolean getCollectIpRouteTable()

collectIpRouteTable

public void collectIpRouteTable(boolean ipRouteTable)

getCollectStpNode

public boolean getCollectStpNode()

collectStpNode

public void collectStpNode(boolean stpNode)

getCollectStpTable

public boolean getCollectStpTable()

collectStpTable

public void collectStpTable(boolean stpTable)

getPackageName

public String getPackageName()
Specified by:
getPackageName in interface ReadyRunnable

setPackageName

public void setPackageName(String packageName)
Specified by:
setPackageName in interface ReadyRunnable

getSaveStpNodeTable

public boolean getSaveStpNodeTable()

saveStpNodeTable

public void saveStpNodeTable(boolean stpNodeTable)

getSaveIpRouteTable

public boolean getSaveIpRouteTable()

SaveIpRouteTable

public void SaveIpRouteTable(boolean ipRouteTable)

getSaveStpInterfaceTable

public boolean getSaveStpInterfaceTable()

saveStpInterfaceTable

public void saveStpInterfaceTable(boolean stpInterfaceTable)


Copyright © 2009. All Rights Reserved.