case SEARCH_RESULT_DONE:
// Store the response into the responseQueue
SearchResultDone searchResultDone = ( SearchResultDone ) response;
SearchFuture searchFuture = ( SearchFuture ) responseFuture;
if ( LOG.isDebugEnabled() )
{
if ( searchResultDone.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
{
// Everything is fine, return the response
LOG.debug( "Search successful : {}", searchResultDone );
}
else
{
// We have had an error
LOG.debug( "Search failed : {}", searchResultDone );
}
}
// Store the response into the future
searchFuture.set( searchResultDone );
// Remove the future from the map
removeFromFutureMaps( messageId );
break;
case SEARCH_RESULT_ENTRY:
// Store the response into the responseQueue
SearchResultEntry searchResultEntry = ( SearchResultEntry ) response;
if ( schemaManager != null )
{
searchResultEntry.setEntry( new DefaultEntry( schemaManager, searchResultEntry.getEntry() ) );
}
searchFuture = ( SearchFuture ) responseFuture;
if ( LOG.isDebugEnabled() )
{
LOG.debug( "Search entry found : {}", searchResultEntry );
}
// Store the response into the future
searchFuture.set( searchResultEntry );
break;
case SEARCH_RESULT_REFERENCE:
// Store the response into the responseQueue
SearchResultReference searchResultReference = ( SearchResultReference ) response;
searchFuture = ( SearchFuture ) responseFuture;
if ( LOG.isDebugEnabled() )
{
LOG.debug( "Search reference found : {}", searchResultReference );
}
// Store the response into the future
searchFuture.set( searchResultReference );
break;
default:
throw new IllegalStateException( "Unexpected response type " + response.getType() );