Interface IPFilter
- All Known Implementing Classes:
IPFilterImpl, RPIPFilter
public interface IPFilter
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a range.voidExplicitly bans an addressvoidExplicitly blocks an addresscreateAndAddRange(String description, String start_ip, String end_ip, boolean this_session_only) Creates, validates and adds a rangecreateRange(int address_type, boolean this_session_only) creates a new range but *doesn't* add it to the list.IPBanned[]Gets the current list of b addressesGets the current list of blocked addressesgetFile()Gets the file name used for persistent rangesbooleanThe filter either allows defined ranges to be allowed or denied accesslongGets the last time the filter set was updated or marked as up to dateintreturns length of banned ip listintreturns length of blocked ip listintreturns length of ranges listIPRange[]Gets the current set of defined IP rangesbooleanTest if ipfilter is enabled or notbooleanChecks an address to see if its in an allowed rangevoidreload()Reloads the ip filter from the config file (obtainable using "getFile")voidremoveRange(IPRange range) Remove a rangevoidsave()saves current setting to file given by getFilevoidsetEnabled(boolean enabled) change the enabled statusvoidsetInRangeAddressesAreAllowed(boolean b) Set the behaviour of the filter to either allow or deny access for defined rangesvoidRemoves a ban on an address
-
Method Details
-
getFile
-
createRange
creates a new range but *doesn't* add it to the list. Use the add method to add it- Parameters:
address_type- - 1= ipv4, 2=ipv6this_session_only- // not persisted if "this_session_only" is true- Returns:
-
addRange
Adds a range. Only ranges created with "create" above can be added- Parameters:
range-
-
createAndAddRange
-
removeRange
-
reload
Reloads the ip filter from the config file (obtainable using "getFile")- Throws:
IPFilterException
-
getRanges
-
getNumberOfRanges
int getNumberOfRanges()returns length of ranges list- Returns:
-
isInRange
Checks an address to see if its in an allowed range- Parameters:
IPAddress-- Returns:
-
getBlockedIPs
-
getNumberOfBlockedIPs
int getNumberOfBlockedIPs()returns length of blocked ip list- Returns:
-
block
-
getBannedIPs
-
getNumberOfBannedIPs
int getNumberOfBannedIPs()returns length of banned ip list- Returns:
- Since:
- 2.5.0.2
-
ban
-
unban
-
getInRangeAddressesAreAllowed
boolean getInRangeAddressesAreAllowed()The filter either allows defined ranges to be allowed or denied access- Returns:
-
setInRangeAddressesAreAllowed
void setInRangeAddressesAreAllowed(boolean b) Set the behaviour of the filter to either allow or deny access for defined ranges- Parameters:
b-
-
isEnabled
boolean isEnabled()Test if ipfilter is enabled or not- Returns:
-
setEnabled
void setEnabled(boolean enabled) change the enabled status- Parameters:
enabled-
-
save
saves current setting to file given by getFile- Throws:
IPFilterException
-
getLastUpdateTime
long getLastUpdateTime()Gets the last time the filter set was updated or marked as up to date- Returns:
-