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.


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
 SnmpTable<SnmpTableEntry> m_ipRoute
          The ipRoute table information
 Map<Vlan,org.opennms.netmgt.linkd.SnmpVlanCollection> m_snmpVlanCollection
          The list of vlan snmp collection object
 SnmpTable<SnmpTableEntry> 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(Linkd linkd, SnmpAgentConfig config)
          Constructs a new snmp collector for a node using the passed interface as the collection point.
 
Method Summary
 void collectBridgeForwardingTable(boolean bridgeForwardingTable)
          collectBridgeForwardingTable
 void collectCdpTable(boolean cdpTable)
          collectCdpTable
 void collectIpRouteTable(boolean ipRouteTable)
          collectIpRouteTable
 void collectStpNode(boolean stpNode)
          collectStpNode
 void collectStpTable(boolean stpTable)
          collectStpTable
 boolean collectVlanTable()
          collectVlanTable
 boolean equals(ReadyRunnable run)
          equals
 boolean getCollectBridgeForwardingTable()
          getCollectBridgeForwardingTable
 boolean getCollectCdpTable()
          getCollectCdpTable
 boolean getCollectIpRouteTable()
          getCollectIpRouteTable
 boolean getCollectStpNode()
          getCollectStpNode
 boolean getCollectStpTable()
          getCollectStpTable
 String getInfo()
          getInfo
 long getInitialSleepTime()
          getInitialSleepTime
 String getIpRouteClass()
           
 String getPackageName()
          Getter for the field packageName.
 SnmpAgentConfig getPeer()
          getPeer
 long getPollInterval()
          getPollInterval
 int getPort()
          getPort
 String getReadCommunity()
          getReadCommunity
 boolean getSaveIpRouteTable()
          getSaveIpRouteTable
 boolean getSaveStpInterfaceTable()
          getSaveStpInterfaceTable
 boolean getSaveStpNodeTable()
          getSaveStpNodeTable
 Scheduler getScheduler()
          getScheduler
 InetAddress getTarget()
          Returns the target address that the collection occured for.
 String getVlanClass()
          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()
          isReady
 boolean isSuspended()
          isSuspended
 void run()
           Performs the collection for the targeted internet address.
 void SaveIpRouteTable(boolean ipRouteTable)
          SaveIpRouteTable
 void saveStpInterfaceTable(boolean stpInterfaceTable)
          saveStpInterfaceTable
 void saveStpNodeTable(boolean stpNodeTable)
          saveStpNodeTable
 void schedule()
          schedule
 void setInitialSleepTime(long initial_sleep_time)
          setInitialSleepTime
 void setIpRouteClass(String className)
           
 void setPackageName(String packageName)
          setPackageName
 void setPollInterval(long interval)
          setPollInterval
 void setScheduler(Scheduler scheduler)
          setScheduler
 void setVlanClass(String className)
          setVlanClass
 void suspend()
          suspend
 void unschedule()
          unschedule
 void wakeUp()
          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 SnmpTable<SnmpTableEntry> m_ipRoute
The ipRoute table information


m_CdpCache

public CdpCacheTable m_CdpCache
The CdpCache table information


m_vlanTable

public SnmpTable<SnmpTableEntry> 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(Linkd linkd,
                      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.

Parameters:
m_vlan - a int.
Returns:
a String object.

getVlanIndex

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

Parameters:
m_vlanname - a String object.
Returns:
a int.

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 synchronization must be added.

Specified by:
run in interface Runnable

getScheduler

public Scheduler getScheduler()

getScheduler

Returns:
a Scheduler object.

setScheduler

public void setScheduler(Scheduler scheduler)

setScheduler

Parameters:
scheduler - a Scheduler object.

getInitialSleepTime

public long getInitialSleepTime()

getInitialSleepTime

Returns:
Returns the initial_sleep_time.

setInitialSleepTime

public void setInitialSleepTime(long initial_sleep_time)

setInitialSleepTime

Parameters:
initial_sleep_time - The initial_sleep_timeto set.

getPollInterval

public long getPollInterval()

getPollInterval

Returns:
Returns the initial_sleep_time.

setPollInterval

public void setPollInterval(long interval)

setPollInterval

Parameters:
interval - a long.

schedule

public void schedule()

schedule

Specified by:
schedule in interface ReadyRunnable

isReady

public boolean isReady()

isReady

Specified by:
isReady in interface ReadyRunnable
Returns:
a boolean.

isSuspended

public boolean isSuspended()

isSuspended

Specified by:
isSuspended in interface ReadyRunnable
Returns:
Returns the suspendCollection.

suspend

public void suspend()

suspend

Specified by:
suspend in interface ReadyRunnable

wakeUp

public void wakeUp()

wakeUp

Specified by:
wakeUp in interface ReadyRunnable

unschedule

public void unschedule()

unschedule

Specified by:
unschedule in interface ReadyRunnable

getIpRouteClass

public String getIpRouteClass()

setIpRouteClass

public void setIpRouteClass(String className)

getVlanClass

public String getVlanClass()

getVlanClass

Returns:
Returns the m_vlanClass.

setVlanClass

public void setVlanClass(String className)

setVlanClass

Parameters:
className - a String object.

getTarget

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

Returns:
a InetAddress object.

collectVlanTable

public boolean collectVlanTable()

collectVlanTable

Returns:
Returns the m_collectVlanTable.

getReadCommunity

public String getReadCommunity()

getReadCommunity

Returns:
a String object.

getPeer

public SnmpAgentConfig getPeer()

getPeer

Returns:
a SnmpAgentConfig object.

getPort

public int getPort()

getPort

Returns:
a int.

equals

public boolean equals(ReadyRunnable run)

equals

Specified by:
equals in interface ReadyRunnable
Parameters:
run - a ReadyRunnable object.
Returns:
a boolean.

getInfo

public String getInfo()

getInfo

Specified by:
getInfo in interface ReadyRunnable
Returns:
a String object.

getCollectBridgeForwardingTable

public boolean getCollectBridgeForwardingTable()

getCollectBridgeForwardingTable

Returns:
a boolean.

collectBridgeForwardingTable

public void collectBridgeForwardingTable(boolean bridgeForwardingTable)

collectBridgeForwardingTable

Parameters:
bridgeForwardingTable - a boolean.

getCollectCdpTable

public boolean getCollectCdpTable()

getCollectCdpTable

Returns:
a boolean.

collectCdpTable

public void collectCdpTable(boolean cdpTable)

collectCdpTable

Parameters:
cdpTable - a boolean.

getCollectIpRouteTable

public boolean getCollectIpRouteTable()

getCollectIpRouteTable

Returns:
a boolean.

collectIpRouteTable

public void collectIpRouteTable(boolean ipRouteTable)

collectIpRouteTable

Parameters:
ipRouteTable - a boolean.

getCollectStpNode

public boolean getCollectStpNode()

getCollectStpNode

Returns:
a boolean.

collectStpNode

public void collectStpNode(boolean stpNode)

collectStpNode

Parameters:
stpNode - a boolean.

getCollectStpTable

public boolean getCollectStpTable()

getCollectStpTable

Returns:
a boolean.

collectStpTable

public void collectStpTable(boolean stpTable)

collectStpTable

Parameters:
stpTable - a boolean.

getPackageName

public String getPackageName()

Getter for the field packageName.

Specified by:
getPackageName in interface ReadyRunnable
Returns:
a String object.

setPackageName

public void setPackageName(String packageName)

setPackageName

Specified by:
setPackageName in interface ReadyRunnable
Parameters:
packageName - a String object.

getSaveStpNodeTable

public boolean getSaveStpNodeTable()

getSaveStpNodeTable

Returns:
a boolean.

saveStpNodeTable

public void saveStpNodeTable(boolean stpNodeTable)

saveStpNodeTable

Parameters:
stpNodeTable - a boolean.

getSaveIpRouteTable

public boolean getSaveIpRouteTable()

getSaveIpRouteTable

Returns:
a boolean.

SaveIpRouteTable

public void SaveIpRouteTable(boolean ipRouteTable)

SaveIpRouteTable

Parameters:
ipRouteTable - a boolean.

getSaveStpInterfaceTable

public boolean getSaveStpInterfaceTable()

getSaveStpInterfaceTable

Returns:
a boolean.

saveStpInterfaceTable

public void saveStpInterfaceTable(boolean stpInterfaceTable)

saveStpInterfaceTable

Parameters:
stpInterfaceTable - a boolean.


Copyright © 2011. All Rights Reserved.