public abstract class LinkdConfigManager extends Object implements LinkdConfig
Abstract LinkdConfigManager class.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_IP_ROUTE_CLASS_NAME |
protected static LinkdConfiguration |
m_config
Object containing all Linkd-configuration objects parsed from the XML
file
|
Constructor and Description |
---|
LinkdConfigManager(InputStream stream)
Constructor for LinkdConfigManager.
|
Modifier and Type | Method and Description |
---|---|
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()
Return the linkd configuration object.
|
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 name)
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()
Whether autodiscovery is enabled in linkd-config (default: false)
|
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()
Whether vlan discovery is enabled in linkd-config (default: true)
|
protected void |
reloadXML(InputStream stream)
reloadXML
|
protected void |
reloadXML(Reader reader)
Deprecated.
|
void |
save()
Saves the current in-memory configuration to disk and reloads
|
boolean |
saveRouteTable()
saveRouteTable
|
boolean |
saveStpInterfaceTable()
saveStpInterfaceTable
|
boolean |
saveStpNodeTable()
saveStpNodeTable
|
protected abstract void |
saveXml(String xml)
saveXml
|
abstract void |
update()
update
|
void |
updatePackageIpListMap()
This method is used to establish package against IP list mapping, with
which, the IP list is selected per package via the configured filter rules
from the database.
|
boolean |
useBridgeDiscovery()
useBridgeDiscovery
|
boolean |
useCdpDiscovery()
useCdpDiscovery
|
boolean |
useIpRouteDiscovery()
useIpRouteDiscovery
|
public static final String DEFAULT_IP_ROUTE_CLASS_NAME
protected static LinkdConfiguration m_config
public LinkdConfigManager(InputStream stream) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, IOException
Constructor for LinkdConfigManager.
stream
- a InputStream
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.public Lock getReadLock()
getReadLock
in interface LinkdConfig
public Lock getWriteLock()
getWriteLock
in interface LinkdConfig
public boolean isAutoDiscoveryEnabled()
isAutoDiscoveryEnabled
in interface LinkdConfig
public boolean isVlanDiscoveryEnabled()
isVlanDiscoveryEnabled
in interface LinkdConfig
public boolean isInterfaceInPackage(InetAddress iface, Package pkg)
isInterfaceInPackage
in interface LinkdConfig
iface
- The interface to test against the package.pkg
- The package to check for the inclusion of the interface.public boolean isInterfaceInPackageRange(InetAddress iface, Package pkg)
LinkdConfig
isInterfaceInPackageRange
in interface LinkdConfig
iface
- The interface to test against the package.pkg
- The package to check for the inclusion of the interface.public Enumeration<Package> enumeratePackage()
enumeratePackage
enumeratePackage
in interface LinkdConfig
Enumeration
object.public LinkdConfiguration getConfiguration()
getConfiguration
in interface LinkdConfig
LinkdConfiguration
object.public Package getPackage(String name)
getPackage
getPackage
in interface LinkdConfig
name
- a String
object.Package
object.public List<InetAddress> getIpList(Package pkg)
getIpList
in interface LinkdConfig
pkg
- a Package
object.List
object.public String getIpRouteClassName(String sysoid)
getIpRouteClassName
in interface LinkdConfig
public String getVlanClassName(String sysoid)
getVlanClassName
getVlanClassName
in interface LinkdConfig
sysoid
- a String
object.String
object.public Package getFirstPackageMatch(InetAddress ipaddr)
getFirstPackageMatch
in interface LinkdConfig
ipaddr
- the interface to checkpublic List<String> getAllPackageMatches(InetAddress ipaddr)
getAllPackageMatches
in interface LinkdConfig
ipaddr
- a String
object.public boolean hasClassName(String sysoid)
hasClassName
hasClassName
in interface LinkdConfig
sysoid
- a String
object.public String getDefaultIpRouteClassName()
getDefaultIpRouteClassName
in interface LinkdConfig
public abstract void update() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
update
update
in interface LinkdConfig
IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public void updatePackageIpListMap()
updatePackageIpListMap
in interface LinkdConfig
public boolean useIpRouteDiscovery()
useIpRouteDiscovery
useIpRouteDiscovery
in interface LinkdConfig
public boolean saveRouteTable()
saveRouteTable
saveRouteTable
in interface LinkdConfig
public boolean useCdpDiscovery()
useCdpDiscovery
useCdpDiscovery
in interface LinkdConfig
public boolean useBridgeDiscovery()
useBridgeDiscovery
useBridgeDiscovery
in interface LinkdConfig
public boolean saveStpNodeTable()
saveStpNodeTable
saveStpNodeTable
in interface LinkdConfig
public boolean enableDiscoveryDownload()
enableDiscoveryDownload
enableDiscoveryDownload
in interface LinkdConfig
public boolean saveStpInterfaceTable()
saveStpInterfaceTable
saveStpInterfaceTable
in interface LinkdConfig
public long getInitialSleepTime()
LinkdConfig
getInitialSleepTime
getInitialSleepTime
in interface LinkdConfig
public long getSnmpPollInterval()
LinkdConfig
getSnmpPollInterval
getSnmpPollInterval
in interface LinkdConfig
public long getDiscoveryLinkInterval()
LinkdConfig
getDiscoveryLinkInterval
getDiscoveryLinkInterval
in interface LinkdConfig
public int getThreads()
getThreads
getThreads
in interface LinkdConfig
public boolean hasIpRouteClassName(String sysoid)
hasIpRouteClassName
in interface LinkdConfig
@Deprecated protected void reloadXML(Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, IOException
reloadXML
reader
- a Reader
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.protected void reloadXML(InputStream stream) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, IOException
reloadXML
stream
- a InputStream
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.public void save() throws org.exolab.castor.xml.MarshalException, IOException, org.exolab.castor.xml.ValidationException
save
in interface LinkdConfig
org.exolab.castor.xml.MarshalException
- if any.IOException
- if any.org.exolab.castor.xml.ValidationException
- if any.protected abstract void saveXml(String xml) throws IOException
saveXml
xml
- a String
object.IOException
- if any.public boolean forceIpRouteDiscoveryOnEthernet()
forceIpRouteDiscoveryOnEthernet
in interface LinkdConfig
Copyright © 2015. All Rights Reserved.