|
||||||||||
| 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,
java.util.Collection<? extends org.apache.mina.filter.firewall.Subnet> collection)
Creates a new instance of DefaultIpFilter. |
|
DefaultIpFilter(IpFilterType type,
java.lang.String addresses)
Creates a new instance of DefaultIpFilter. |
|
| Method Summary | |
|---|---|
boolean |
accept(java.net.InetAddress address)
Tells whether or not the given IP address is accepted by this filter. |
boolean |
add(java.lang.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 type
public DefaultIpFilter(IpFilterType type,
java.util.Collection<? extends org.apache.mina.filter.firewall.Subnet> collection)
DefaultIpFilter.
type - the filter typecollection - a collection of Subnets to filter out/in.
public DefaultIpFilter(IpFilterType type,
java.lang.String addresses)
throws java.lang.NumberFormatException,
java.net.UnknownHostException
DefaultIpFilter.
type - the filter typeaddresses - a comma, space, tab, LF separated list of IP addresses/CIDRs.
java.net.UnknownHostException - propagated
java.lang.NumberFormatException - propagated| Method Detail |
|---|
public IpFilterType getType()
public void setType(IpFilterType type)
type - the type of this filter.
public boolean add(java.lang.String str)
throws java.lang.NumberFormatException,
java.net.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.
java.lang.NumberFormatException - propagated
java.net.UnknownHostException - propagatedpublic boolean accept(java.net.InetAddress address)
IpFilter
accept in interface IpFilteraddress - 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 | |||||||||