Package org.opennms.netmgt.config
Class RancidAdapterConfigManager
- java.lang.Object
-
- org.opennms.netmgt.config.RancidAdapterConfigManager
-
- All Implemented Interfaces:
RancidAdapterConfig
- Direct Known Subclasses:
RancidAdapterConfigFactory
public abstract class RancidAdapterConfigManager extends Object implements RancidAdapterConfig
Abstract RancidAdapterConfigManager class.
- Author:
- Antonio Russo, Mathew Brozowski, David Hustace
-
-
Constructor Summary
Constructors Constructor Description RancidAdapterConfigManager()
Constructor for RancidAdapterConfigManager.RancidAdapterConfigManager(InputStream reader)
Constructor for RancidAdapterConfigManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 executionLock
getReadLock()
int
getRetries(String ipaddr)
return the number of retries in case of failure for the specified addressList<Schedule>
getSchedules(String ipaddress)
getSchedulesString
getType(String sysoid, String sysdescr)
return the Rancid Type StringLock
getWriteLock()
boolean
hasSchedule(String ipaddress)
hasScheduleIterable<String>
includeURLs(Package pkg)
includeURLsboolean
isCurTimeInSchedule(String ipaddr)
Return if current time is ready to be scheduled.Iterable<Mapping>
mappings()
mappingsIterable<Package>
packages()
packagesIterable<PolicyManage>
policies()
policiesvoid
rebuildPackageIpListMap()
This method is used to rebuild the package against iplist mapping when needed.protected void
reloadXML(InputStream is)
reloadXMLboolean
useCategories(String ipaddr)
return if is to be used the opennms categories to get rancid device type
-
-
-
Constructor Detail
-
RancidAdapterConfigManager
public RancidAdapterConfigManager(InputStream reader) throws IOException
Constructor for RancidAdapterConfigManager.
- Parameters:
reader
- aInputStream
object.- Throws:
IOException
- if any.
-
RancidAdapterConfigManager
public RancidAdapterConfigManager()
Constructor for RancidAdapterConfigManager.
-
-
Method Detail
-
getReadLock
public Lock getReadLock()
-
getWriteLock
public Lock getWriteLock()
-
reloadXML
protected void reloadXML(InputStream is) throws IOException
reloadXML
- Parameters:
is
- aInputStream
object.- Throws:
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 interfaceRancidAdapterConfig
- 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 interfaceRancidAdapterConfig
- 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 interfaceRancidAdapterConfig
- Parameters:
ipaddr
- the ipaddress of the node- Returns:
- true if use opennms category
-
getType
public String getType(String sysoid, String sysdescr)
return the Rancid Type String- Specified by:
getType
in interfaceRancidAdapterConfig
- 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 interfaceRancidAdapterConfig
- 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
- aString
object.- Returns:
- a boolean.
-
policies
public Iterable<PolicyManage> policies()
policies
- 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 against 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.
-
-