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

Constructor Summary
DiscoveryLink()
          Constructs a new DiscoveryLink object .
 
Method Summary
 boolean discoveryUsingBridge()
          discoveryUsingBridge
 boolean discoveryUsingCdp()
          discoveryUsingCdp
 boolean discoveryUsingRoutes()
          discoveryUsingRoutes
 boolean equals(ReadyRunnable r)
          equals
 long getDiscoveryInterval()
          getDiscoveryInterval
 String getInfo()
          getInfo
 long getInitialSleepTime()
          getInitialSleepTime
 Linkd getLinkd()
           
 NodeToNodeLink[] getLinks()
          Getter for the field links.
 MacToNodeLink[] getMacLinks()
          getMacLinks
 String getPackageName()
          Getter for the field packageName.
 Scheduler getScheduler()
          Return the Scheduler
 long getSnmpPollInterval()
          getSnmpPollInterval
 boolean isEnableDownloadDiscovery()
          isEnableDownloadDiscovery
 boolean isForceIpRouteDiscoveryOnEtherNet()
          isForceIpRouteDiscoveryOnEtherNet
 boolean isReady()
          isReady
 boolean isSuspended()
          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)
          setDiscoveryInterval
 void setDiscoveryUsingBridge(boolean discoveryUsingBridge)
          Setter for the field discoveryUsingBridge.
 void setDiscoveryUsingCdp(boolean discoveryUsingCdp)
          Setter for the field discoveryUsingCdp.
 void setDiscoveryUsingRoutes(boolean discoveryUsingRoutes)
          Setter for the field discoveryUsingRoutes.
 void setEnableDownloadDiscovery(boolean enableDownloaddiscovery)
          Setter for the field enableDownloadDiscovery.
 void setForceIpRouteDiscoveryOnEtherNet(boolean forceIpRouteDiscoveryOnEtherNet)
          Setter for the field forceIpRouteDiscoveryOnEtherNet.
 void setInitialSleepTime(long initial_sleep_time)
          setInitialSleepTime
 void setLinkd(Linkd linkd)
           
 void setPackageName(String packageName)
          setPackageName
 void setScheduler(Scheduler scheduler)
          Set the Scheduler
 void setSnmpPollInterval(long interval)
          setSnmpPollInterval
 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
 

Constructor Detail

DiscoveryLink

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

Method Detail

setLinkd

public void setLinkd(Linkd linkd)
Parameters:
linkd - the linkd to set

getLinkd

public Linkd getLinkd()

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:
a Scheduler object.

setScheduler

public void setScheduler(Scheduler scheduler)
Set the Scheduler

Parameters:
scheduler - a Scheduler object.

schedule

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

Specified by:
schedule in interface ReadyRunnable

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.

isReady

public boolean isReady()

isReady

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

getDiscoveryInterval

public long getDiscoveryInterval()

getDiscoveryInterval

Returns:
Returns the discovery_link_interval.

setSnmpPollInterval

public void setSnmpPollInterval(long interval)

setSnmpPollInterval

Parameters:
interval - The discovery_link_interval to set.

getSnmpPollInterval

public long getSnmpPollInterval()

getSnmpPollInterval

Returns:
Returns the discovery_link_interval.

setDiscoveryInterval

public void setDiscoveryInterval(long interval)

setDiscoveryInterval

Parameters:
interval - The discovery_link_interval to set.

getLinks

public NodeToNodeLink[] getLinks()

Getter for the field links.

Returns:
an array of NodeToNodeLink objects.

getMacLinks

public MacToNodeLink[] getMacLinks()

getMacLinks

Returns:
an array of MacToNodeLink objects.

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

equals

public boolean equals(ReadyRunnable r)

equals

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

getInfo

public String getInfo()

getInfo

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

discoveryUsingBridge

public boolean discoveryUsingBridge()

discoveryUsingBridge

Returns:
a boolean.

setDiscoveryUsingBridge

public void setDiscoveryUsingBridge(boolean discoveryUsingBridge)

Setter for the field discoveryUsingBridge.

Parameters:
discoveryUsingBridge - a boolean.

discoveryUsingCdp

public boolean discoveryUsingCdp()

discoveryUsingCdp

Returns:
a boolean.

setDiscoveryUsingCdp

public void setDiscoveryUsingCdp(boolean discoveryUsingCdp)

Setter for the field discoveryUsingCdp.

Parameters:
discoveryUsingCdp - a boolean.

discoveryUsingRoutes

public boolean discoveryUsingRoutes()

discoveryUsingRoutes

Returns:
a boolean.

setDiscoveryUsingRoutes

public void setDiscoveryUsingRoutes(boolean discoveryUsingRoutes)

Setter for the field discoveryUsingRoutes.

Parameters:
discoveryUsingRoutes - 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.

isEnableDownloadDiscovery

public boolean isEnableDownloadDiscovery()

isEnableDownloadDiscovery

Returns:
a boolean.

setEnableDownloadDiscovery

public void setEnableDownloadDiscovery(boolean enableDownloaddiscovery)

Setter for the field enableDownloadDiscovery.

Parameters:
enableDownloaddiscovery - a boolean.

isForceIpRouteDiscoveryOnEtherNet

public boolean isForceIpRouteDiscoveryOnEtherNet()

isForceIpRouteDiscoveryOnEtherNet

Returns:
a boolean.

setForceIpRouteDiscoveryOnEtherNet

public void setForceIpRouteDiscoveryOnEtherNet(boolean forceIpRouteDiscoveryOnEtherNet)

Setter for the field forceIpRouteDiscoveryOnEtherNet.

Parameters:
forceIpRouteDiscoveryOnEtherNet - a boolean.


Copyright © 2011. All Rights Reserved.