public class RemoteIpFilter extends CopyOnWriteArraySet<org.apache.mina.filter.firewall.Subnet> implements SessionFilter
SessionFilter interface, to filter
sessions based on the remote IP address.| Constructor and Description |
|---|
RemoteIpFilter(IpFilterType type)
Creates a new instance of
RemoteIpFilter. |
RemoteIpFilter(IpFilterType type,
Collection<? extends org.apache.mina.filter.firewall.Subnet> collection)
Creates a new instance of
RemoteIpFilter. |
RemoteIpFilter(IpFilterType type,
String addresses)
Creates a new instance of
RemoteIpFilter. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(org.apache.mina.core.session.IoSession session)
Tells whether or not the given session 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.
|
add, addAll, clear, contains, containsAll, equals, forEach, isEmpty, iterator, remove, removeAll, removeIf, retainAll, size, spliterator, toArray, toArrayhashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitparallelStream, streampublic RemoteIpFilter(IpFilterType type)
RemoteIpFilter.type - the filter typepublic RemoteIpFilter(IpFilterType type, Collection<? extends org.apache.mina.filter.firewall.Subnet> collection)
RemoteIpFilter.type - the filter typecollection - a collection of Subnets to filter out/in.public RemoteIpFilter(IpFilterType type, String addresses) throws NumberFormatException, UnknownHostException
RemoteIpFilter.type - the filter typeaddresses - a comma, space, tab, CR, LF separated list of IP
addresses/CIDRs.UnknownHostException - propagatedNumberFormatException - propagatedpublic 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 notationtrue, if the
given element was added to the filter; false, if the
element already exists in the filter.NumberFormatException - propagatedUnknownHostException - propagatedpublic boolean accept(org.apache.mina.core.session.IoSession session)
SessionFilteraccept in interface SessionFiltersession - the session to checktrue, if the given session is accepted by this
filter; false, otherwise.Copyright © 2003–2017 The Apache Software Foundation. All rights reserved.