Class RPIPFilter
java.lang.Object
com.biglybt.pifimpl.remote.RPObject
com.biglybt.pifimpl.remote.ipfilter.RPIPFilter
- All Implemented Interfaces:
IPFilter
,Serializable
- See Also:
-
Field Summary
FieldsFields inherited from class com.biglybt.pifimpl.remote.RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_setDelegate
(Object _delegate) void
Adds a range.void
Explicitly bans an addressvoid
Explicitly blocks an addressstatic IPFilter
createAndAddRange
(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 rangesboolean
The filter either allows defined ranges to be allowed or denied accesslong
Gets the last time the filter set was updated or marked as up to dateint
returns length of banned ip listint
returns length of blocked ip listint
returns length of ranges listIPRange[]
Gets the current set of defined IP rangesboolean
Test if ipfilter is enabled or notboolean
Checks an address to see if its in an allowed rangevoid
reload()
Reloads the ip filter from the config file (obtainable using "getFile")void
removeRange
(IPRange range) Remove a rangevoid
save()
saves current setting to file given by getFilevoid
setEnabled
(boolean value) change the enabled statusvoid
setInRangeAddressesAreAllowed
(boolean value) Set the behaviour of the filter to either allow or deny access for defined rangesvoid
Removes a ban on an addressMethods inherited from class com.biglybt.pifimpl.remote.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:
_setDelegate
in classRPObject
-
_setLocal
- Overrides:
_setLocal
in classRPObject
- Throws:
RPException
-
_process
-
getFile
Description copied from interface:IPFilter
Gets the file name used for persistent ranges -
createRange
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 interfaceIPFilter
- Parameters:
address_type
- - 1= ipv4, 2=ipv6this_session_only
- // not persisted if "this_session_only" is true- Returns:
-
addRange
Description copied from interface:IPFilter
Adds a range. Only ranges created with "create" above can be added -
createAndAddRange
public IPRange createAndAddRange(String description, String start_ip, String end_ip, boolean this_session_only) Description copied from interface:IPFilter
Creates, validates and adds a range- Specified by:
createAndAddRange
in 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:IPFilter
Remove a range- Specified by:
removeRange
in interfaceIPFilter
- Parameters:
range
-
-
reload
Description copied from interface:IPFilter
Reloads the ip filter from the config file (obtainable using "getFile")- Specified by:
reload
in interfaceIPFilter
- Throws:
IPFilterException
-
getRanges
Description copied from interface:IPFilter
Gets the current set of defined IP ranges -
isInRange
Description copied from interface:IPFilter
Checks an address to see if its in an allowed range -
getBlockedIPs
Description copied from interface:IPFilter
Gets the current list of blocked addresses- Specified by:
getBlockedIPs
in interfaceIPFilter
- Returns:
-
block
Description copied from interface:IPFilter
Explicitly blocks an address -
getBannedIPs
Description copied from interface:IPFilter
Gets the current list of b addresses- Specified by:
getBannedIPs
in interfaceIPFilter
- Returns:
-
ban
Description copied from interface:IPFilter
Explicitly bans an address -
unban
Description copied from interface:IPFilter
Removes a ban on an address -
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 interfaceIPFilter
- 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 interfaceIPFilter
- Parameters:
value
-
-
isEnabled
public boolean isEnabled()Description copied from interface:IPFilter
Test if ipfilter is enabled or not -
setEnabled
public void setEnabled(boolean value) Description copied from interface:IPFilter
change the enabled status- Specified by:
setEnabled
in interfaceIPFilter
- Parameters:
value
-
-
save
Description copied from interface:IPFilter
saves current setting to file given by getFile- Specified by:
save
in interfaceIPFilter
- Throws:
IPFilterException
-
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 interfaceIPFilter
- Returns:
-
getNumberOfRanges
public int getNumberOfRanges()Description copied from interface:IPFilter
returns length of ranges list- Specified by:
getNumberOfRanges
in interfaceIPFilter
- Returns:
-
getNumberOfBlockedIPs
public int getNumberOfBlockedIPs()Description copied from interface:IPFilter
returns length of blocked ip list- Specified by:
getNumberOfBlockedIPs
in interfaceIPFilter
- Returns:
-
getNumberOfBannedIPs
public int getNumberOfBannedIPs()Description copied from interface:IPFilter
returns length of banned ip list- Specified by:
getNumberOfBannedIPs
in interfaceIPFilter
- Returns:
-