|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.util.netmatcher.NetMatcher
public class NetMatcher
NetMatcher Class is used to check if an ipAddress match a network. NetMatcher provides a means for checking whether a particular IPv4 or IPv6 address or domain name is within a set of subnets.
| Constructor Summary | |
|---|---|
NetMatcher(java.util.Collection<java.lang.String> nets,
DNSService dnsServer)
Create a new instance of Netmatcher. |
|
NetMatcher(java.lang.String[] nets,
DNSService dnsServer)
Create a new instance of Netmatcher. |
|
| Method Summary | |
|---|---|
protected void |
log(java.lang.String s)
Can be overwritten for logging |
boolean |
matchInetNetwork(java.net.InetAddress ip)
Return true if passed InetAddress match a network which was used to construct the Netmatcher. |
boolean |
matchInetNetwork(java.lang.String hostIP)
The given String may represent an IP address or a host name. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NetMatcher(java.lang.String[] nets,
DNSService dnsServer)
nets - a String[] which holds all networksdnsServer - the DNSService which will be used in this class
public NetMatcher(java.util.Collection<java.lang.String> nets,
DNSService dnsServer)
nets - a Collection which holds all networksdnsServer - the DNSService which will be used in this class| Method Detail |
|---|
public boolean matchInetNetwork(java.lang.String hostIP)
hostIP - the ipAddress or host name to checkmatchInetNetwork(InetAddress)public boolean matchInetNetwork(java.net.InetAddress ip)
an - InetAddress
public java.lang.String toString()
toString in class java.lang.ObjectInetNetwork#toString()protected void log(java.lang.String s)
s - the String to log
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||