* This valve enforces request accpetance/denial based on the string
* representation of the remote client's IP address.
*/
void configureRemoteAddressFilterValve() {
RemoteAddrValve remoteAddrValve = null;
if (vsBean == null) {
return;
}
ElementProperty allow = vsBean.getElementPropertyByName(
"allowRemoteAddress");
ElementProperty deny = vsBean.getElementPropertyByName(
"denyRemoteAddress");
if ((allow != null && allow.getValue() != null)
|| (deny != null && deny.getValue() != null)) {
remoteAddrValve = new RemoteAddrValve();
}
if (allow != null && allow.getValue() != null) {
_logger.fine("Allowing access to " + getID()+ " from " +
allow.getValue());
remoteAddrValve.setAllow(allow.getValue());
}
if (deny != null && deny.getValue() != null) {
_logger.fine("Denying access to " + getID()+ " from " +
deny.getValue());
remoteAddrValve.setDeny(deny.getValue());
}
if (remoteAddrValve != null) {
// Remove existing RemoteAddrValve (if any), in case of a reconfig
Valve[] valves = getValves();