|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.authenticate.IPMatcher
public class IPMatcher
Quickly tests whether a given IPv4 4-byte address matches an IP range. An
IPMatcher is initialized with a particular IP range specification.
Calls to match method will then quickly
determine whether a given IP falls within that range.
Supported range specifications areL
12.34.56.7812.34 (which matches any IP starting
12.34)18.25.0.0/255.255.0.018.25.0.0/16
| Constructor Summary | |
|---|---|
IPMatcher(String ipSpec)
Construct an IPMatcher that will test for the given IP specification |
|
| Method Summary | |
|---|---|
boolean |
match(String ipIn)
Determine whether the given full IP falls within the range this IPMatcher was initialized with. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IPMatcher(String ipSpec)
throws IPMatcherException
ipSpec - IP specification (full or partial URL, network/netmask,
network/cidr)
IPMatcherException - if there is an error parsing the specification (i.e. it is
somehow malformed)| Method Detail |
|---|
public boolean match(String ipIn)
throws IPMatcherException
IPMatcher was initialized with.
ipIn - IP address as dot-delimited String
true if the IP matches the range of this
IPMatcher; false otherwise
IPMatcherException - if the IP passed in cannot be parsed correctly (i.e. is
malformed)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||