org.opennms.netmgt.config
Class MapsAdapterConfigManager

java.lang.Object
  extended by org.opennms.netmgt.config.MapsAdapterConfigManager
All Implemented Interfaces:
MapsAdapterConfig
Direct Known Subclasses:
MapsAdapterConfigFactory

public abstract class MapsAdapterConfigManager
extends Object
implements MapsAdapterConfig

Abstract MapsAdapterConfigManager class.

Author:
Antonio Russo, Mathew Brozowski, David Hustace

Constructor Summary
MapsAdapterConfigManager()
          Constructor for MapsAdapterConfigManager.
MapsAdapterConfigManager(InputStream reader, String serverName, boolean verifyServer)
          Constructor for MapsAdapterConfigManager.
 
Method Summary
 List<Cmap> getAllMaps()
          getAllMaps
 List<String> getAllPackageMatches(String ipaddr)
          Returns a list of package names that the ip belongs to, null if none.
 Map<String,List<Celement>> getCelements()
          getCelements
 MapsAdapterConfiguration getConfiguration()
          Return the poller configuration object.
 Map<String,Csubmap> getContainerMaps(String submapName)
          getContainerMaps
 Map<String,Celement> getElementByAddress(String ipaddr)
          getElementByAddress
 int getMapElementDimension()
          getMapElementDimension
 Lock getReadLock()
           
 Map<String,List<Csubmap>> getsubMaps()
          getsubMaps
 List<Csubmap> getSubMaps(String mapName)
          getSubMaps
 Lock getWriteLock()
           
 Iterable<String> includeURLs(Package pkg)
          includeURLs
 Iterable<Package> packages()
          packages
 void rebuildPackageIpListMap()
          This method is used to rebuild the package against IP list mapping when needed.
protected  void reloadXML(InputStream reader)
          reloadXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opennms.netmgt.config.MapsAdapterConfig
update
 

Constructor Detail

MapsAdapterConfigManager

public MapsAdapterConfigManager(InputStream reader,
                                String serverName,
                                boolean verifyServer)
                         throws org.exolab.castor.xml.MarshalException,
                                org.exolab.castor.xml.ValidationException,
                                IOException

Constructor for MapsAdapterConfigManager.

Parameters:
reader - a InputStream object.
verifyServer - a boolean.
serverName - a String object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
IOException - if any.

MapsAdapterConfigManager

public MapsAdapterConfigManager()

Constructor for MapsAdapterConfigManager.

Method Detail

getReadLock

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

getWriteLock

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

reloadXML

protected void reloadXML(InputStream reader)
                  throws org.exolab.castor.xml.MarshalException,
                         org.exolab.castor.xml.ValidationException,
                         IOException

reloadXML

Parameters:
reader - a InputStream object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
IOException - if any.

getAllPackageMatches

public List<String> getAllPackageMatches(String ipaddr)
Returns a list of package names that the ip belongs to, null if none. Note: Evaluation of the interface against a package filter will only work if the IP is already in the database.

Parameters:
ipaddr - the interface to check
Returns:
a list of package names that the ip belongs to, null if none

packages

public Iterable<Package> packages()

packages

Returns:
a Iterable object.

includeURLs

public Iterable<String> includeURLs(Package pkg)

includeURLs

Parameters:
pkg - a Package object.
Returns:
a Iterable object.

getConfiguration

public MapsAdapterConfiguration getConfiguration()
Return the poller configuration object.

Returns:
a MapsAdapterConfiguration object.

getAllMaps

public List<Cmap> getAllMaps()

getAllMaps

Specified by:
getAllMaps in interface MapsAdapterConfig
Returns:
a List object.

getElementByAddress

public Map<String,Celement> getElementByAddress(String ipaddr)

getElementByAddress

Specified by:
getElementByAddress in interface MapsAdapterConfig
Parameters:
ipaddr - a String object.
Returns:
a Map object.

getSubMaps

public List<Csubmap> getSubMaps(String mapName)

getSubMaps

Specified by:
getSubMaps in interface MapsAdapterConfig
Parameters:
mapName - a String object.
Returns:
a List object.

getMapElementDimension

public int getMapElementDimension()

getMapElementDimension

Specified by:
getMapElementDimension in interface MapsAdapterConfig
Returns:
a int.

getContainerMaps

public Map<String,Csubmap> getContainerMaps(String submapName)

getContainerMaps

Specified by:
getContainerMaps in interface MapsAdapterConfig
Parameters:
submapName - a String object.
Returns:
a Map object.

getsubMaps

public Map<String,List<Csubmap>> getsubMaps()

getsubMaps

Specified by:
getsubMaps in interface MapsAdapterConfig
Returns:
a Map object.

getCelements

public Map<String,List<Celement>> getCelements()

getCelements

Specified by:
getCelements in interface MapsAdapterConfig
Returns:
a Map object.

rebuildPackageIpListMap

public void rebuildPackageIpListMap()
This method is used to rebuild the package against IP list mapping when needed. When a node gained service event occurs, poller has to determine which package the IP/service combination is in, but if the interface is a newly added one, the package IP list should be rebuilt so that poller could know which package this IP/service pair is in.

Specified by:
rebuildPackageIpListMap in interface MapsAdapterConfig


Copyright © 2011. All Rights Reserved.