org.opennms.netmgt.config
Class RancidAdapterConfigManager

java.lang.Object
  extended by org.opennms.netmgt.config.RancidAdapterConfigManager
All Implemented Interfaces:
RancidAdapterConfig
Direct Known Subclasses:
RancidAdapterConfigFactory

public abstract class RancidAdapterConfigManager
extends Object
implements RancidAdapterConfig

Author:
Antonio Russo, Mathew Brozowski, David Hustace

Constructor Summary
RancidAdapterConfigManager()
           
RancidAdapterConfigManager(Reader reader, String serverName, boolean verifyServer)
           
 
Method Summary
 RancidConfiguration getConfiguration()
          Return the Rancid Adapter configuration object.
 long getDelay(String ipaddr)
          return the delay time for the specified address the delay time is the time in msec that represents a delay in the execution of a RancidAdapter execution
 int getRetries(String ipaddr)
          return the number of retries in case of failure for the specified address
 List<Schedule> getSchedules(String ipaddress)
           
 String getType(String sysoid)
          return the Rancid Type String
 boolean hasSchedule(String ipaddress)
           
 Iterable<String> includeURLs(Package pkg)
           
 boolean isCurTimeInSchedule(String ipaddr)
          Return if current time is ready to be scheduled.
 Iterable<Mapping> mappings()
           
 Iterable<Package> packages()
           
 Iterable<PolicyManage> policies()
           
 void rebuildPackageIpListMap()
          This method is used to rebuild the package agaist iplist mapping when needed.
protected  void reloadXML(Reader reader)
           
 boolean useCategories(String ipaddr)
          return if is to be used the opennms categories to get rancid device type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RancidAdapterConfigManager

public RancidAdapterConfigManager(Reader reader,
                                  String serverName,
                                  boolean verifyServer)
                           throws org.exolab.castor.xml.MarshalException,
                                  org.exolab.castor.xml.ValidationException,
                                  IOException
Parameters:
reader -
localServer -
verifyServer -
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException

RancidAdapterConfigManager

public RancidAdapterConfigManager()
Method Detail

reloadXML

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

getDelay

public long getDelay(String ipaddr)
Description copied from interface: RancidAdapterConfig
return the delay time for the specified address the delay time is the time in msec that represents a delay in the execution of a RancidAdapter execution

Specified by:
getDelay in interface RancidAdapterConfig
Parameters:
ipaddr - the ipaddress of the node
Returns:
the delay time

getRetries

public int getRetries(String ipaddr)
Description copied from interface: RancidAdapterConfig
return the number of retries in case of failure for the specified address

Specified by:
getRetries in interface RancidAdapterConfig
Parameters:
ipaddr - the ipaddress of the node
Returns:
the number of retries

useCategories

public boolean useCategories(String ipaddr)
Description copied from interface: RancidAdapterConfig
return if is to be used the opennms categories to get rancid device type

Specified by:
useCategories in interface RancidAdapterConfig
Parameters:
ipaddr - the ipaddress of the node
Returns:
true if use opennms category

getType

public String getType(String sysoid)
Description copied from interface: RancidAdapterConfig
return the Rancid Type String

Specified by:
getType in interface RancidAdapterConfig
Parameters:
sysoid - the system OID identifier of the node
Returns:
RancidType String

isCurTimeInSchedule

public boolean isCurTimeInSchedule(String ipaddr)
Description copied from interface: RancidAdapterConfig
Return if current time is ready to be scheduled.

Specified by:
isCurTimeInSchedule in interface RancidAdapterConfig
Parameters:
ipaddr - the ipaddress of the node
Returns:
true if current time is in a schedules under policy manage

hasSchedule

public boolean hasSchedule(String ipaddress)

getSchedules

public List<Schedule> getSchedules(String ipaddress)

packages

public Iterable<Package> packages()

mappings

public Iterable<Mapping> mappings()

policies

public Iterable<PolicyManage> policies()

includeURLs

public Iterable<String> includeURLs(Package pkg)

getConfiguration

public RancidConfiguration getConfiguration()
Return the Rancid Adapter configuration object.


rebuildPackageIpListMap

public void rebuildPackageIpListMap()
This method is used to rebuild the package agaist iplist 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 iplist should be rebuilt so that poller could know which package this ip/service pair is in.



Copyright © 2009. All Rights Reserved.