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 RancidConfigurationgetConfiguration()Return the Rancid Adapter configuration object.longgetDelay(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 executionLockgetReadLock()intgetRetries(String ipaddr)return the number of retries in case of failure for the specified addressList<Schedule>getSchedules(String ipaddress)getSchedulesStringgetType(String sysoid, String sysdescr)return the Rancid Type StringLockgetWriteLock()booleanhasSchedule(String ipaddress)hasScheduleIterable<String>includeURLs(Package pkg)includeURLsbooleanisCurTimeInSchedule(String ipaddr)Return if current time is ready to be scheduled.Iterable<Mapping>mappings()mappingsIterable<Package>packages()packagesIterable<PolicyManage>policies()policiesvoidrebuildPackageIpListMap()This method is used to rebuild the package against iplist mapping when needed.protected voidreloadXML(InputStream is)reloadXMLbooleanuseCategories(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- aInputStreamobject.- 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- aInputStreamobject.- 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:
getDelayin 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:
getRetriesin 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:
useCategoriesin 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:
getTypein 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:
isCurTimeInSchedulein 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- aStringobject.- Returns:
- a boolean.
-
policies
public Iterable<PolicyManage> policies()
policies
- Returns:
- a
Iterableobject.
-
getConfiguration
public RancidConfiguration getConfiguration()
Return the Rancid Adapter configuration object.- Returns:
- a
RancidConfigurationobject.
-
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.
-
-