public boolean accessDenied ( InetAddress remoteAddr ) { String hostname = null ; //F184719 // check the inclusion lists first to see if the client matches if ( includeAccess . getActive ( ) || includeAccessNames . getActive ( ) ) { boolean closeSocket = true ; if ( includeAccess . getActive ( ) ) { if ( remoteAddr instanceof Inet6Address ) { if ( includeAccess . findInList6 ( remoteAddr . getAddress ( ) ) ) { closeSocket = false ; } } else { if ( includeAccess . findInList ( remoteAddr . getAddress ( ) ) ) { closeSocket = false ; } } } if ( closeSocket && includeAccessNames . getActive ( ) ) { // look at hostnames to check inclusion hostname = remoteAddr . getHostName ( ) ; if ( caseInsensitiveHostnames && ( hostname != null ) ) { hostname = hostname . toLowerCase ( ) ; } if ( includeAccessNames . findInList ( hostname ) ) { closeSocket = false ; } } if ( closeSocket ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Address and host name not in include list, address: " + remoteAddr . getHostAddress ( ) + " host name: " + remoteAddr . getHostName ( ) ) ; return true ; } } if ( excludeAccess . getActive ( ) || excludeAccessNames . getActive ( ) ) { boolean closeSocket = false ; if ( excludeAccess . getActive ( ) ) { if ( remoteAddr instanceof Inet6Address ) { if ( excludeAccess . findInList6 ( remoteAddr . getAddress ( ) ) ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Address (IPv6) in exclude list, address: " + remoteAddr . getHostAddress ( ) ) ; return true ; } } else { if ( excludeAccess . findInList ( remoteAddr . getAddress ( ) ) ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Address in exclude list, address: " + remoteAddr . getHostAddress ( ) ) ; return true ; } } } if ( closeSocket == false && excludeAccessNames . getActive ( ) ) { // look at hostnames to check exclusion hostname = remoteAddr . getHostName ( ) ; if ( caseInsensitiveHostnames && ( hostname != null ) ) { hostname = hostname . toLowerCase ( ) ; } if ( excludeAccessNames . findInList ( hostname ) ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Host name in exclude list, host name: " + remoteAddr . getHostName ( ) ) ; return true ; } } } // end if(there are excludes to check) return false ; }
Query whether a given client address is denied by this configuration .