Methods Summary |
---|
public void | initInetNetworks(java.util.Collection nets)
networks = new ArrayList();
for (Iterator iter = nets.iterator(); iter.hasNext(); ) try
{
InetNetwork net = InetNetwork.getFromString((String) iter.next());
if (!networks.contains(net)) networks.add(net);
}
catch (java.net.UnknownHostException uhe)
{
log("Cannot resolve address: " + uhe.getMessage());
}
networks.trimToSize();
|
public void | initInetNetworks(java.lang.String[] nets)
networks = new ArrayList();
for (int i = 0; i < nets.length; i++) try
{
InetNetwork net = InetNetwork.getFromString(nets[i]);
if (!networks.contains(net)) networks.add(net);
}
catch (java.net.UnknownHostException uhe)
{
log("Cannot resolve address: " + uhe.getMessage());
}
networks.trimToSize();
|
protected void | log(java.lang.String s)
|
public boolean | matchInetNetwork(java.lang.String hostIP)
InetAddress ip = null;
try
{
ip = org.apache.james.dnsserver.DNSServer.getByName(hostIP);
}
catch (java.net.UnknownHostException uhe)
{
log("Cannot resolve address for " + hostIP + ": " + uhe.getMessage());
}
boolean sameNet = false;
if (ip != null) for (Iterator iter = networks.iterator(); (!sameNet) && iter.hasNext(); )
{
InetNetwork network = (InetNetwork) iter.next();
sameNet = network.contains(ip);
}
return sameNet;
|
public boolean | matchInetNetwork(java.net.InetAddress ip)
boolean sameNet = false;
for (Iterator iter = networks.iterator(); (!sameNet) && iter.hasNext(); )
{
InetNetwork network = (InetNetwork) iter.next();
sameNet = network.contains(ip);
}
return sameNet;
|
public java.lang.String | toString()
return networks.toString();
|