@Configurable public class IfNetwork extends java.lang.Object implements RequestPredicate
<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 and Description |
---|
IfNetwork() |
Modifier and Type | Method and Description |
---|---|
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() |
@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