@ SneakyThrows protected boolean executeSearchForSpnegoAttribute ( final String remoteIp ) { val remoteHostName = getRemoteHostName ( remoteIp ) ; LOGGER . debug ( "Resolved remote hostname [{}] based on ip [{}]" , remoteHostName , remoteIp ) ; try ( val connection = createConnection ( ) ) { val searchOperation = new SearchOperation ( connection ) ; this . searchRequest . getSearchFilter ( ) . setParameter ( "host" , remoteHostName ) ; LOGGER . debug ( "Using search filter [{}] on baseDn [{}]" , this . searchRequest . getSearchFilter ( ) . format ( ) , this . searchRequest . getBaseDn ( ) ) ; val searchResult = searchOperation . execute ( this . searchRequest ) ; if ( searchResult . getResultCode ( ) == ResultCode . SUCCESS ) { return processSpnegoAttribute ( searchResult ) ; } throw new IllegalArgumentException ( "Failed to establish a connection ldap. " + searchResult . getMessage ( ) ) ; } }
Searches the ldap instance for the attribute value .