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

Abstract RancidAdapterConfigManager class.

Version:
$Id: $
Author:
Antonio Russo, Mathew Brozowski, David Hustace, Antonio Russo, Mathew Brozowski, David Hustace, Antonio Russo, Mathew Brozowski, David Hustace

Constructor Summary
RancidAdapterConfigManager()
          Constructor for RancidAdapterConfigManager.
RancidAdapterConfigManager(InputStream reader, String serverName, boolean verifyServer)
          Constructor for RancidAdapterConfigManager.
 
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)
          getSchedules
 String getType(String sysoid)
          return the Rancid Type String
 boolean hasSchedule(String ipaddress)
          hasSchedule
 Iterable<String> includeURLs(Package pkg)
          includeURLs
 boolean isCurTimeInSchedule(String ipaddr)
          Return if current time is ready to be scheduled.
 Iterable<Mapping> mappings()
          mappings
 Iterable<Package> packages()
          packages
 Iterable<PolicyManage> policies()
          policies
 void rebuildPackageIpListMap()
          This method is used to rebuild the package agaist iplist mapping when needed.
protected  void reloadXML(InputStream reader)
          reloadXML
 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(InputStream reader,
                                  String serverName,
                                  boolean verifyServer)
                           throws org.exolab.castor.xml.MarshalException,
                                  org.exolab.castor.xml.ValidationException,
                                  IOException

Constructor for RancidAdapterConfigManager.

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.

RancidAdapterConfigManager

public RancidAdapterConfigManager()

Constructor for RancidAdapterConfigManager.

Method Detail

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.

getDelay

public 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

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

getRetries

public int getRetries(String ipaddr)
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)
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)
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)
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)

hasSchedule

Parameters:
ipaddress - a String object.
Returns:
a boolean.

getSchedules

public List<Schedule> getSchedules(String ipaddress)

getSchedules

Parameters:
ipaddress - a String object.
Returns:
a List object.

packages

public Iterable<Package> packages()

packages

Returns:
a Iterable object.

mappings

public Iterable<Mapping> mappings()

mappings

Returns:
a Iterable object.

policies

public Iterable<PolicyManage> policies()

policies

Returns:
a Iterable object.

includeURLs

public Iterable<String> includeURLs(Package pkg)

includeURLs

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

getConfiguration

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

Returns:
a RancidConfiguration 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 © 2011. All Rights Reserved.