org.opennms.netmgt.linkd
Class DiscoveryLink

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

public final class DiscoveryLink
extends Object
implements ReadyRunnable

This class is designed to discover link among nodes using the collected and the necessary SNMP information. When the class is initially constructed no information is used.

Author:
Antonio Russo , OpenNMS

Constructor Summary
DiscoveryLink()
          Constructs a new DiscoveryLink object .
 
Method Summary
 boolean discoveryUsingBridge()
           
 boolean discoveryUsingCdp()
           
 boolean discoveryUsingRoutes()
           
 boolean equals(ReadyRunnable r)
           
 long getDiscoveryInterval()
           
 String getInfo()
           
 long getInitialSleepTime()
           
 NodeToNodeLink[] getLinks()
           
 MacToNodeLink[] getMacLinks()
           
 String getPackageName()
           
 Scheduler getScheduler()
          Return the Scheduler
 long getSnmpPollInterval()
           
 boolean isEnableDownloadDiscovery()
           
 boolean isForceIpRouteDiscoveryOnEtherNet()
           
 boolean isReady()
          Returns true if the runnable is ready to start.
 boolean isSuspended()
           
 void run()
           Performs link discovery for the Nodes and save info in DatalinkInterface table on DataBase
 void schedule()
          This Method is called when DiscoveryLink is initialized
 void setDiscoveryInterval(long interval)
           
 void setDiscoveryUsingBridge(boolean discoveryUsingBridge)
           
 void setDiscoveryUsingCdp(boolean discoveryUsingCdp)
           
 void setDiscoveryUsingRoutes(boolean discoveryUsingRoutes)
           
 void setEnableDownloadDiscovery(boolean enableDownloaddiscovery)
           
 void setForceIpRouteDiscoveryOnEtherNet(boolean forceIpRouteDiscoveryOnEtherNet)
           
 void setInitialSleepTime(long initial_sleep_time)
           
 void setPackageName(String packageName)
           
 void setScheduler(Scheduler scheduler)
          Set the Scheduler
 void setSnmpPollInterval(long interval)
           
 void suspend()
           
 void unschedule()
           
 void wakeUp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoveryLink

public DiscoveryLink()
Constructs a new DiscoveryLink object . The discovery does not occur until the run method is invoked.

Method Detail

run

public void run()

Performs link discovery for the Nodes and save info in DatalinkInterface table on DataBase

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()
Return the Scheduler

Returns:

setScheduler

public void setScheduler(Scheduler scheduler)
Set the Scheduler

Parameters:
scheduler -

schedule

public void schedule()
This Method is called when DiscoveryLink is initialized

Specified by:
schedule in interface ReadyRunnable

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.

isReady

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

Specified by:
isReady in interface ReadyRunnable

getDiscoveryInterval

public long getDiscoveryInterval()
Returns:
Returns the discovery_link_interval.

setSnmpPollInterval

public void setSnmpPollInterval(long interval)
Parameters:
interval - The discovery_link_interval to set.

getSnmpPollInterval

public long getSnmpPollInterval()
Returns:
Returns the discovery_link_interval.

setDiscoveryInterval

public void setDiscoveryInterval(long interval)
Parameters:
interval - The discovery_link_interval to set.

getLinks

public NodeToNodeLink[] getLinks()

getMacLinks

public MacToNodeLink[] getMacLinks()

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

equals

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

getInfo

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

discoveryUsingBridge

public boolean discoveryUsingBridge()

setDiscoveryUsingBridge

public void setDiscoveryUsingBridge(boolean discoveryUsingBridge)

discoveryUsingCdp

public boolean discoveryUsingCdp()

setDiscoveryUsingCdp

public void setDiscoveryUsingCdp(boolean discoveryUsingCdp)

discoveryUsingRoutes

public boolean discoveryUsingRoutes()

setDiscoveryUsingRoutes

public void setDiscoveryUsingRoutes(boolean discoveryUsingRoutes)

getPackageName

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

setPackageName

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

isEnableDownloadDiscovery

public boolean isEnableDownloadDiscovery()

setEnableDownloadDiscovery

public void setEnableDownloadDiscovery(boolean enableDownloaddiscovery)

isForceIpRouteDiscoveryOnEtherNet

public boolean isForceIpRouteDiscoveryOnEtherNet()

setForceIpRouteDiscoveryOnEtherNet

public void setForceIpRouteDiscoveryOnEtherNet(boolean forceIpRouteDiscoveryOnEtherNet)


Copyright © 2009. All Rights Reserved.