|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.rewrite.IfNetwork
@Configurable public class IfNetwork
Match if the remote IP address matches one of the pattern networks. Standard IP network syntax is allowed, so 192.168/16 matches the entire subnetwork.
<resin:Allow url-pattern="/admin/*" xmlns:resin="urn:java:com.caucho.resin"> <resin:IfNetwork value="192.168.17.0/24"/> </resin:Allow>
<resin:Forbidden xmlns:resin="urn:java:com.caucho.resin"> <resin:IfNetwork> <value>205.11.12.3</value> <value>123.4.45.6</value> <value>233.15.25.35</value> <value>233.14.87.12</value> </resin:IfNetwork> </resin:Forbidden>
RequestPredicates may be used for both security and rewrite conditions.
Constructor Summary | |
---|---|
IfNetwork()
|
Method Summary | |
---|---|
void |
addValue(java.lang.String network)
Add an ip network to allow. |
int |
getCacheSize()
Size of the cache used to hold whether or not to allow a certain IP address. |
void |
init()
|
boolean |
isMatch(HttpServletRequest request)
True if the predicate matches. |
void |
setCacheSize(int cacheSize)
Size of the cache used to hold whether or not to allow a certain IP address, default is 256. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IfNetwork()
Method Detail |
---|
@Configurable public void setCacheSize(int cacheSize)
public int getCacheSize()
@Configurable public void addValue(java.lang.String network) throws java.net.UnknownHostException
java.net.UnknownHostException
@PostConstruct public void init() throws ConfigException
ConfigException
public boolean isMatch(HttpServletRequest request)
isMatch
in interface RequestPredicate
request
- the servlet request to testpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |