|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.concurrent.CopyOnWriteArraySet<org.apache.mina.filter.firewall.Subnet>
org.apache.ftpserver.ipfilter.DefaultIpFilter
public class DefaultIpFilter
Default implementation of the IpFilter
interface, which uses
specific IP addresses or ranges of IP addresses that can be blocked or
allowed.
Constructor Summary | |
---|---|
DefaultIpFilter(IpFilterType type)
Creates a new instance of DefaultIpFilter . |
|
DefaultIpFilter(IpFilterType type,
Collection<? extends org.apache.mina.filter.firewall.Subnet> collection)
Creates a new instance of DefaultIpFilter . |
|
DefaultIpFilter(IpFilterType type,
String addresses)
Creates a new instance of DefaultIpFilter . |
Method Summary | |
---|---|
boolean |
accept(InetAddress address)
Tells whether or not the given IP address is accepted by this filter. |
boolean |
add(String str)
Adds the given string representation of InetAddress or CIDR notation to this filter. |
IpFilterType |
getType()
Returns the type of this filter. |
void |
setType(IpFilterType type)
Sets the type of this filter. |
Methods inherited from class java.util.concurrent.CopyOnWriteArraySet |
---|
add, addAll, clear, contains, containsAll, equals, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from class java.util.AbstractSet |
---|
hashCode |
Methods inherited from class java.util.AbstractCollection |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultIpFilter(IpFilterType type)
DefaultIpFilter
.
type
- the filter typepublic DefaultIpFilter(IpFilterType type, Collection<? extends org.apache.mina.filter.firewall.Subnet> collection)
DefaultIpFilter
.
type
- the filter typecollection
- a collection of Subnet
s to filter out/in.public DefaultIpFilter(IpFilterType type, String addresses) throws NumberFormatException, UnknownHostException
DefaultIpFilter
.
type
- the filter typeaddresses
- a comma, space, tab, LF separated list of IP addresses/CIDRs.
UnknownHostException
- propagated
NumberFormatException
- propagatedMethod Detail |
---|
public IpFilterType getType()
public void setType(IpFilterType type)
type
- the type of this filter.public boolean add(String str) throws NumberFormatException, UnknownHostException
str
- the string representation of InetAddress or CIDR notation
true
, if the
given element was added to the filter; false
, if the
element already exists in the filter.
NumberFormatException
- propagated
UnknownHostException
- propagatedpublic boolean accept(InetAddress address)
IpFilter
accept
in interface IpFilter
address
- the IP address to check
true
, if the given IP address is accepted by this
filter; false
, otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |