Class RancidAdapterConfigManager

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RancidConfiguration getConfiguration()
      Return the Rancid Adapter configuration object.
      long getDelay​(java.lang.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
      java.util.concurrent.locks.Lock getReadLock()  
      int getRetries​(java.lang.String ipaddr)
      return the number of retries in case of failure for the specified address
      java.util.List<Schedule> getSchedules​(java.lang.String ipaddress)
      getSchedules
      java.lang.String getType​(java.lang.String sysoid, java.lang.String sysdescr)
      return the Rancid Type String
      java.util.concurrent.locks.Lock getWriteLock()  
      boolean hasSchedule​(java.lang.String ipaddress)
      hasSchedule
      java.lang.Iterable<java.lang.String> includeURLs​(Package pkg)
      includeURLs
      boolean isCurTimeInSchedule​(java.lang.String ipaddr)
      Return if current time is ready to be scheduled.
      java.lang.Iterable<Mapping> mappings()
      mappings
      java.lang.Iterable<Package> packages()
      packages
      java.lang.Iterable<PolicyManage> policies()
      policies
      void rebuildPackageIpListMap()
      This method is used to rebuild the package against iplist mapping when needed.
      protected void reloadXML​(java.io.InputStream is)
      reloadXML
      boolean useCategories​(java.lang.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​(java.io.InputStream reader)
                                   throws java.io.IOException

        Constructor for RancidAdapterConfigManager.

        Parameters:
        reader - a InputStream object.
        Throws:
        java.io.IOException - if any.
      • RancidAdapterConfigManager

        public RancidAdapterConfigManager()

        Constructor for RancidAdapterConfigManager.

    • Method Detail

      • getReadLock

        public java.util.concurrent.locks.Lock getReadLock()
      • getWriteLock

        public java.util.concurrent.locks.Lock getWriteLock()
      • reloadXML

        protected void reloadXML​(java.io.InputStream is)
                          throws java.io.IOException

        reloadXML

        Parameters:
        is - a InputStream object.
        Throws:
        java.io.IOException - if any.
      • getDelay

        public long getDelay​(java.lang.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​(java.lang.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​(java.lang.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 java.lang.String getType​(java.lang.String sysoid,
                                        java.lang.String sysdescr)
        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​(java.lang.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​(java.lang.String ipaddress)

        hasSchedule

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

        public java.util.List<Schedule> getSchedules​(java.lang.String ipaddress)

        getSchedules

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

        public java.lang.Iterable<Package> packages()

        packages

        Returns:
        a Iterable object.
      • mappings

        public java.lang.Iterable<Mapping> mappings()

        mappings

        Returns:
        a Iterable object.
      • policies

        public java.lang.Iterable<PolicyManage> policies()

        policies

        Returns:
        a Iterable object.
      • includeURLs

        public java.lang.Iterable<java.lang.String> includeURLs​(Package pkg)

        includeURLs

        Parameters:
        pkg - a Package object.
        Returns:
        a Iterable 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.