class RangerIpMatcher extends RangerAbstractConditionEvaluator {

	@Override
	public boolean isMatched(final RangerAccessRequest request) {
		if(LOG.isDebugEnabled()) {
			LOG.debug("==> RangerIpMatcher.isMatched(" + request + ")");
		}

		boolean ipMatched = true;
		if (_allowAny) {
			LOG.debug("isMatched: allowAny flag is true.  Matched!");
		} else {
			String requestIp = extractIp(request);
			if (requestIp == null) {
				LOG.debug("isMatched: couldn't get ip address from request.  Ok.  Implicitly matched!");
			} else {
				ipMatched = isWildcardMatched(_wildCardIps, requestIp) || isExactlyMatched(_exactIps, requestIp);
			}
		}
		
		if(LOG.isDebugEnabled()) {
			LOG.debug("<== RangerIpMatcher.isMatched(" + request+ "): " + ipMatched);
		}

		return ipMatched;
	}

}