org.opennms.netmgt.config.mock
Class MockLinkdConfig

java.lang.Object
  extended by org.opennms.netmgt.config.mock.MockLinkdConfig
All Implemented Interfaces:
LinkdConfig

public class MockLinkdConfig
extends Object
implements LinkdConfig


Constructor Summary
MockLinkdConfig()
           
 
Method Summary
 boolean enableDiscoveryDownload()
          enableDiscoveryDownload
 Enumeration<Package> enumeratePackage()
          enumeratePackage
 boolean forceIpRouteDiscoveryOnEthernet()
           
 List<String> getAllPackageMatches(InetAddress ipAddr)
          Returns true if the IP is part of at least one package.
 LinkdConfiguration getConfiguration()
          getConfiguration
 String getDefaultIpRouteClassName()
           
 long getDiscoveryLinkInterval()
          getDiscoveryLinkInterval
 Package getFirstPackageMatch(InetAddress ipaddr)
          Returns the first package that the ip belongs to, null if none.
 long getInitialSleepTime()
          getInitialSleepTime
 List<InetAddress> getIpList(Package pkg)
          Determine the list of IPs the filter rule for this package allows
 String getIpRouteClassName(String sysoid)
           
 Package getPackage(String pkgName)
          getPackage
 Lock getReadLock()
           
 long getSnmpPollInterval()
          getSnmpPollInterval
 int getThreads()
          getThreads
 String getVlanClassName(String sysoid)
          getVlanClassName
 Lock getWriteLock()
           
 boolean hasClassName(String sysoid)
          hasClassName
 boolean hasIpRouteClassName(String sysoid)
           
 boolean isAutoDiscoveryEnabled()
           
 boolean isInterfaceInPackage(InetAddress iface, Package pkg)
          This method is used to determine if the named interface is included in the passed package definition.
 boolean isInterfaceInPackageRange(InetAddress iface, Package pkg)
          This method is used to determine if the named interface is included in the passed package definition.
 boolean isVlanDiscoveryEnabled()
           
 void save()
          save
 boolean saveRouteTable()
          saveRouteTable
 boolean saveStpInterfaceTable()
          saveStpInterfaceTable
 boolean saveStpNodeTable()
          saveStpNodeTable
 void update()
          update
 void updatePackageIpListMap()
          createPackageIpListMap
 boolean useBridgeDiscovery()
          useBridgeDiscovery
 boolean useCdpDiscovery()
          useCdpDiscovery
 boolean useIpRouteDiscovery()
          useIpRouteDiscovery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockLinkdConfig

public MockLinkdConfig()
Method Detail

getIpList

public List<InetAddress> getIpList(Package pkg)
Description copied from interface: LinkdConfig
Determine the list of IPs the filter rule for this package allows

Specified by:
getIpList in interface LinkdConfig
Parameters:
pkg - a Package object.
Returns:
a List object.

isInterfaceInPackage

public boolean isInterfaceInPackage(InetAddress iface,
                                    Package pkg)
Description copied from interface: LinkdConfig
This method is used to determine if the named interface is included in the passed package definition. If the interface belongs to the package then a value of true is returned. If the interface does not belong to the package a false value is returned. Note: Evaluation of the interface against a package filter will only work if the IP is already in the database.

Specified by:
isInterfaceInPackage in interface LinkdConfig
Parameters:
iface - The interface to test against the package.
pkg - The package to check for the inclusion of the interface.
Returns:
True if the interface is included in the package, false otherwise.

isInterfaceInPackageRange

public boolean isInterfaceInPackageRange(InetAddress iface,
                                         Package pkg)
Description copied from interface: LinkdConfig
This method is used to determine if the named interface is included in the passed package definition. If the interface belongs to the package then a value of true is returned. If the interface does not belong to the package a false value is returned. Note: Evaluation of the interface against a package filter will only work if the IP is already in the database.

Specified by:
isInterfaceInPackageRange in interface LinkdConfig
Parameters:
iface - The interface to test against the package.
pkg - The package to check for the inclusion of the interface.
Returns:
True if the interface is included in the package, false otherwise.

getFirstPackageMatch

public Package getFirstPackageMatch(InetAddress ipaddr)
Description copied from interface: LinkdConfig
Returns the first package that the ip belongs to, null if none. Note: Evaluation of the interface against a package filter will only work if the IP is alrady in the database.

Specified by:
getFirstPackageMatch in interface LinkdConfig
Parameters:
ipaddr - the interface to check
Returns:
the first package that the ip belongs to, null if none

getAllPackageMatches

public List<String> getAllPackageMatches(InetAddress ipAddr)
Description copied from interface: LinkdConfig
Returns true if the IP is part of at least one package. Note: Evaluation of the interface against a package filter will only work if the IP is already in the database.

Specified by:
getAllPackageMatches in interface LinkdConfig
Parameters:
ipAddr - a String object.
Returns:
true if the IP is part of at least one package, false otherwise

isAutoDiscoveryEnabled

public boolean isAutoDiscoveryEnabled()
Specified by:
isAutoDiscoveryEnabled in interface LinkdConfig

isVlanDiscoveryEnabled

public boolean isVlanDiscoveryEnabled()
Specified by:
isVlanDiscoveryEnabled in interface LinkdConfig

enumeratePackage

public Enumeration<Package> enumeratePackage()
Description copied from interface: LinkdConfig

enumeratePackage

Specified by:
enumeratePackage in interface LinkdConfig
Returns:
a Enumeration object.

getPackage

public Package getPackage(String pkgName)
Description copied from interface: LinkdConfig

getPackage

Specified by:
getPackage in interface LinkdConfig
Parameters:
pkgName - a String object.
Returns:
a Package object.

getThreads

public int getThreads()
Description copied from interface: LinkdConfig

getThreads

Specified by:
getThreads in interface LinkdConfig
Returns:
a int.

enableDiscoveryDownload

public boolean enableDiscoveryDownload()
Description copied from interface: LinkdConfig

enableDiscoveryDownload

Specified by:
enableDiscoveryDownload in interface LinkdConfig
Returns:
a boolean.

useIpRouteDiscovery

public boolean useIpRouteDiscovery()
Description copied from interface: LinkdConfig

useIpRouteDiscovery

Specified by:
useIpRouteDiscovery in interface LinkdConfig
Returns:
a boolean.

forceIpRouteDiscoveryOnEthernet

public boolean forceIpRouteDiscoveryOnEthernet()
Specified by:
forceIpRouteDiscoveryOnEthernet in interface LinkdConfig

saveRouteTable

public boolean saveRouteTable()
Description copied from interface: LinkdConfig

saveRouteTable

Specified by:
saveRouteTable in interface LinkdConfig
Returns:
a boolean.

useCdpDiscovery

public boolean useCdpDiscovery()
Description copied from interface: LinkdConfig

useCdpDiscovery

Specified by:
useCdpDiscovery in interface LinkdConfig
Returns:
a boolean.

useBridgeDiscovery

public boolean useBridgeDiscovery()
Description copied from interface: LinkdConfig

useBridgeDiscovery

Specified by:
useBridgeDiscovery in interface LinkdConfig
Returns:
a boolean.

saveStpNodeTable

public boolean saveStpNodeTable()
Description copied from interface: LinkdConfig

saveStpNodeTable

Specified by:
saveStpNodeTable in interface LinkdConfig
Returns:
a boolean.

saveStpInterfaceTable

public boolean saveStpInterfaceTable()
Description copied from interface: LinkdConfig

saveStpInterfaceTable

Specified by:
saveStpInterfaceTable in interface LinkdConfig
Returns:
a boolean.

getInitialSleepTime

public long getInitialSleepTime()
Description copied from interface: LinkdConfig

getInitialSleepTime

Specified by:
getInitialSleepTime in interface LinkdConfig
Returns:
a long.

getSnmpPollInterval

public long getSnmpPollInterval()
Description copied from interface: LinkdConfig

getSnmpPollInterval

Specified by:
getSnmpPollInterval in interface LinkdConfig
Returns:
a long.

getDiscoveryLinkInterval

public long getDiscoveryLinkInterval()
Description copied from interface: LinkdConfig

getDiscoveryLinkInterval

Specified by:
getDiscoveryLinkInterval in interface LinkdConfig
Returns:
a long.

update

public void update()
            throws IOException,
                   org.exolab.castor.xml.MarshalException,
                   org.exolab.castor.xml.ValidationException
Description copied from interface: LinkdConfig

update

Specified by:
update in interface LinkdConfig
Throws:
IOException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

save

public void save()
          throws org.exolab.castor.xml.MarshalException,
                 IOException,
                 org.exolab.castor.xml.ValidationException
Description copied from interface: LinkdConfig

save

Specified by:
save in interface LinkdConfig
Throws:
org.exolab.castor.xml.MarshalException - if any.
IOException - if any.
org.exolab.castor.xml.ValidationException - if any.

getConfiguration

public LinkdConfiguration getConfiguration()
Description copied from interface: LinkdConfig

getConfiguration

Specified by:
getConfiguration in interface LinkdConfig
Returns:
a LinkdConfiguration object.

updatePackageIpListMap

public void updatePackageIpListMap()
Description copied from interface: LinkdConfig

createPackageIpListMap

Specified by:
updatePackageIpListMap in interface LinkdConfig

getVlanClassName

public String getVlanClassName(String sysoid)
Description copied from interface: LinkdConfig

getVlanClassName

Specified by:
getVlanClassName in interface LinkdConfig
Parameters:
sysoid - a String object.
Returns:
a String object.

hasClassName

public boolean hasClassName(String sysoid)
Description copied from interface: LinkdConfig

hasClassName

Specified by:
hasClassName in interface LinkdConfig
Parameters:
sysoid - a String object.
Returns:
a boolean.

getReadLock

public Lock getReadLock()
Specified by:
getReadLock in interface LinkdConfig

getWriteLock

public Lock getWriteLock()
Specified by:
getWriteLock in interface LinkdConfig

hasIpRouteClassName

public boolean hasIpRouteClassName(String sysoid)
Specified by:
hasIpRouteClassName in interface LinkdConfig

getIpRouteClassName

public String getIpRouteClassName(String sysoid)
Specified by:
getIpRouteClassName in interface LinkdConfig

getDefaultIpRouteClassName

public String getDefaultIpRouteClassName()
Specified by:
getDefaultIpRouteClassName in interface LinkdConfig


Copyright © 2011. All Rights Reserved.