Class RPIPFilter

    • Field Detail

      • delegate

        protected transient IPFilter delegate
      • last_update_time

        public long last_update_time
      • number_of_ranges

        public int number_of_ranges
      • number_of_blocked_ips

        public int number_of_blocked_ips
    • Constructor Detail

      • RPIPFilter

        protected RPIPFilter​(IPFilter _delegate)
    • Method Detail

      • _setDelegate

        protected void _setDelegate​(java.lang.Object _delegate)
        Overrides:
        _setDelegate in class RPObject
      • getFile

        public java.io.File getFile()
        Description copied from interface: IPFilter
        Gets the file name used for persistent ranges
        Specified by:
        getFile in interface IPFilter
        Returns:
      • createRange

        public IPRange createRange​(int address_type,
                                   boolean this_session_only)
        Description copied from interface: IPFilter
        creates a new range but *doesn't* add it to the list. Use the add method to add it
        Specified by:
        createRange in interface IPFilter
        Parameters:
        address_type - - 1= ipv4, 2=ipv6
        this_session_only - // not persisted if "this_session_only" is true
        Returns:
      • addRange

        public void addRange​(IPRange range)
        Description copied from interface: IPFilter
        Adds a range. Only ranges created with "create" above can be added
        Specified by:
        addRange in interface IPFilter
      • createAndAddRange

        public IPRange createAndAddRange​(java.lang.String description,
                                         java.lang.String start_ip,
                                         java.lang.String end_ip,
                                         boolean this_session_only)
        Description copied from interface: IPFilter
        Creates, validates and adds a range
        Specified by:
        createAndAddRange in interface IPFilter
        this_session_only - not persisted if true
        Returns:
        new range or null if invalid
      • getRanges

        public IPRange[] getRanges()
        Description copied from interface: IPFilter
        Gets the current set of defined IP ranges
        Specified by:
        getRanges in interface IPFilter
        Returns:
      • isInRange

        public boolean isInRange​(java.lang.String IPAddress)
        Description copied from interface: IPFilter
        Checks an address to see if its in an allowed range
        Specified by:
        isInRange in interface IPFilter
        Returns:
      • getBlockedIPs

        public IPBlocked[] getBlockedIPs()
        Description copied from interface: IPFilter
        Gets the current list of blocked addresses
        Specified by:
        getBlockedIPs in interface IPFilter
        Returns:
      • block

        public void block​(java.lang.String IPAddress)
        Description copied from interface: IPFilter
        Explicitly blocks an address
        Specified by:
        block in interface IPFilter
      • getBannedIPs

        public IPBanned[] getBannedIPs()
        Description copied from interface: IPFilter
        Gets the current list of b addresses
        Specified by:
        getBannedIPs in interface IPFilter
        Returns:
      • ban

        public void ban​(java.lang.String IPAddress,
                        java.lang.String text)
        Description copied from interface: IPFilter
        Explicitly bans an address
        Specified by:
        ban in interface IPFilter
      • unban

        public void unban​(java.lang.String IPAddress)
        Description copied from interface: IPFilter
        Removes a ban on an address
        Specified by:
        unban in interface IPFilter
      • getInRangeAddressesAreAllowed

        public boolean getInRangeAddressesAreAllowed()
        Description copied from interface: IPFilter
        The filter either allows defined ranges to be allowed or denied access
        Specified by:
        getInRangeAddressesAreAllowed in interface IPFilter
        Returns:
      • setInRangeAddressesAreAllowed

        public void setInRangeAddressesAreAllowed​(boolean value)
        Description copied from interface: IPFilter
        Set the behaviour of the filter to either allow or deny access for defined ranges
        Specified by:
        setInRangeAddressesAreAllowed in interface IPFilter
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: IPFilter
        Test if ipfilter is enabled or not
        Specified by:
        isEnabled in interface IPFilter
        Returns:
      • setEnabled

        public void setEnabled​(boolean value)
        Description copied from interface: IPFilter
        change the enabled status
        Specified by:
        setEnabled in interface IPFilter
      • getLastUpdateTime

        public long getLastUpdateTime()
        Description copied from interface: IPFilter
        Gets the last time the filter set was updated or marked as up to date
        Specified by:
        getLastUpdateTime in interface IPFilter
        Returns:
      • getNumberOfRanges

        public int getNumberOfRanges()
        Description copied from interface: IPFilter
        returns length of ranges list
        Specified by:
        getNumberOfRanges in interface IPFilter
        Returns:
      • getNumberOfBlockedIPs

        public int getNumberOfBlockedIPs()
        Description copied from interface: IPFilter
        returns length of blocked ip list
        Specified by:
        getNumberOfBlockedIPs in interface IPFilter
        Returns:
      • getNumberOfBannedIPs

        public int getNumberOfBannedIPs()
        Description copied from interface: IPFilter
        returns length of banned ip list
        Specified by:
        getNumberOfBannedIPs in interface IPFilter
        Returns: