public boolean isAccepted ( IRequestInfo req ) { boolean answer = true ; if ( processAll ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processAll is true, therefore we always intercept." ) ; } return answer ; } String HTTPheader = null ; Iterator < ICondition > iter = filterCondition . iterator ( ) ; while ( iter . hasNext ( ) ) { ICondition cond = iter . next ( ) ; String key = cond . getKey ( ) ; // Start with request header attribute name HTTPheader = req . getHeader ( key ) ; boolean ipAddress = false ; // The header argument is a null, so go through other tags. if ( HTTPheader == null ) { if ( key . equals ( REMOTE_ADDRESS ) ) { HTTPheader = req . getRemoteAddr ( ) ; ipAddress = true ; } else if ( key . equals ( REQUEST_URL ) ) { HTTPheader = req . getRequestURL ( ) ; } else if ( key . equals ( AuthFilterConfig . KEY_WEB_APP ) || key . equals ( APPLICATION_NAMES ) ) { HTTPheader = req . getApplicationName ( ) ; } else if ( key . equals ( AuthFilterConfig . KEY_COOKIE ) ) { HTTPheader = req . getCookieName ( key ) ; } else if ( cond instanceof NotContainsCondition ) { continue ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No HTTPheader found, and no remote-address, request-url, webApp, applicationNames, cookie, or requestHeader rule used - do not Intercept." ) ; } return false ; // if no header found, the condition fails } } if ( HTTPheader == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No HTTPheader found - do not Intercept." ) ; } return false ; // if no header found, the condition fails } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Checking condition {0} {1}." , new Object [ ] { cond , HTTPheader } ) ; } try { IValue compareValue ; if ( ipAddress ) { compareValue = new ValueIPAddress ( HTTPheader ) ; } else { compareValue = new ValueString ( HTTPheader ) ; } answer = cond . checkCondition ( compareValue ) ; if ( ! answer ) { break ; } } catch ( FilterException e ) { throw new RuntimeException ( e ) ; } } return answer ; }
Indicates if TAI should intercept request based on pre - defined rules . Basically just execute the conditions created earlier .