// Get the result from the future
try
{
// Read the response, waiting for it if not available immediately
// Get the response, blocking
ExtendedResponse extendedResponse = ( ExtendedResponse ) extendedFuture
.get( timeout, TimeUnit.MILLISECONDS );
if ( extendedResponse == null )
{
// We didn't received anything : this is an error
LOG.error( "Extended failed : timeout occured" );
throw new LdapException( TIME_OUT_ERROR );
}
if ( extendedResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
{
// Everything is fine, return the response
LOG.debug( "Extended successful : {}", extendedResponse );
}
else