// Get the result from the future
try
{
// Read the response, waiting for it if not available immediately
// Get the response, blocking
ModifyResponse modifyResponse = modifyFuture.get( timeout, TimeUnit.MILLISECONDS );
if ( modifyResponse == null )
{
// We didn't received anything : this is an error
LOG.error( "Modify failed : timeout occurred" );
throw new LdapException( TIME_OUT_ERROR );
}
if ( modifyResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
{
// Everything is fine, return the response
LOG.debug( "Modify successful : {}", modifyResponse );
}
else
{
if ( modifyResponse instanceof ModifyNoDResponse )
{
// A NoticeOfDisconnect : deserves a special treatment
throw new LdapException( modifyResponse.getLdapResult().getDiagnosticMessage() );
}
// We have had an error
LOG.debug( "Modify failed : {}", modifyResponse );
}