Class RPIPFilter
java.lang.Object
com.biglybt.pifimpl.remote.RPObject
com.biglybt.pifimpl.remote.ipfilter.RPIPFilter
- All Implemented Interfaces:
IPFilter, Serializable
-
Field Summary
FieldsFields inherited from class RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverse -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_setDelegate(Object _delegate) voidAdds a range.voidExplicitly bans an addressvoidExplicitly blocks an addressstatic IPFiltercreateAndAddRange(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 value) change the enabled statusvoidsetInRangeAddressesAreAllowed(boolean value) Set the behaviour of the filter to either allow or deny access for defined rangesvoidRemoves a ban on an addressMethods inherited from class RPObject
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, _setRemote, getDispatcher, notSupported, notSupported
-
Field Details
-
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 Details
-
RPIPFilter
-
-
Method Details
-
create
-
_setDelegate
- Overrides:
_setDelegatein classRPObject
-
_setLocal
- Overrides:
_setLocalin classRPObject- Throws:
RPException
-
_process
-
getFile
-
createRange
Description copied from interface:IPFiltercreates a new range but *doesn't* add it to the list. Use the add method to add it- Specified by:
createRangein interfaceIPFilter- Parameters:
address_type- - 1= ipv4, 2=ipv6this_session_only- // not persisted if "this_session_only" is true- Returns:
-
addRange
-
createAndAddRange
public IPRange createAndAddRange(String description, String start_ip, String end_ip, boolean this_session_only) Description copied from interface:IPFilterCreates, validates and adds a range- Specified by:
createAndAddRangein interfaceIPFilter- Parameters:
description-start_ip-end_ip-this_session_only- not persisted if true- Returns:
- new range or null if invalid
-
removeRange
Description copied from interface:IPFilterRemove a range- Specified by:
removeRangein interfaceIPFilter- Parameters:
range-
-
reload
Description copied from interface:IPFilterReloads the ip filter from the config file (obtainable using "getFile")- Specified by:
reloadin interfaceIPFilter- Throws:
IPFilterException
-
getRanges
-
isInRange
-
getBlockedIPs
Description copied from interface:IPFilterGets the current list of blocked addresses- Specified by:
getBlockedIPsin interfaceIPFilter- Returns:
-
block
-
getBannedIPs
Description copied from interface:IPFilterGets the current list of b addresses- Specified by:
getBannedIPsin interfaceIPFilter- Returns:
-
ban
-
unban
-
getInRangeAddressesAreAllowed
public boolean getInRangeAddressesAreAllowed()Description copied from interface:IPFilterThe filter either allows defined ranges to be allowed or denied access- Specified by:
getInRangeAddressesAreAllowedin interfaceIPFilter- Returns:
-
setInRangeAddressesAreAllowed
public void setInRangeAddressesAreAllowed(boolean value) Description copied from interface:IPFilterSet the behaviour of the filter to either allow or deny access for defined ranges- Specified by:
setInRangeAddressesAreAllowedin interfaceIPFilter- Parameters:
value-
-
isEnabled
-
setEnabled
public void setEnabled(boolean value) Description copied from interface:IPFilterchange the enabled status- Specified by:
setEnabledin interfaceIPFilter- Parameters:
value-
-
save
Description copied from interface:IPFiltersaves current setting to file given by getFile- Specified by:
savein interfaceIPFilter- Throws:
IPFilterException
-
getLastUpdateTime
public long getLastUpdateTime()Description copied from interface:IPFilterGets the last time the filter set was updated or marked as up to date- Specified by:
getLastUpdateTimein interfaceIPFilter- Returns:
-
getNumberOfRanges
public int getNumberOfRanges()Description copied from interface:IPFilterreturns length of ranges list- Specified by:
getNumberOfRangesin interfaceIPFilter- Returns:
-
getNumberOfBlockedIPs
public int getNumberOfBlockedIPs()Description copied from interface:IPFilterreturns length of blocked ip list- Specified by:
getNumberOfBlockedIPsin interfaceIPFilter- Returns:
-
getNumberOfBannedIPs
public int getNumberOfBannedIPs()Description copied from interface:IPFilterreturns length of banned ip list- Specified by:
getNumberOfBannedIPsin interfaceIPFilter- Returns:
-