err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return;
}
}
CompareResponseProtocolOp op =
responseMessage.getCompareResponseProtocolOp();
int resultCode = op.getResultCode();
Message errorMessage = op.getErrorMessage();
if(resultCode != COMPARE_TRUE && resultCode != COMPARE_FALSE
&& !compareOptions.continueOnError())
{
Message msg = INFO_OPERATION_FAILED.get("COMPARE");
throw new LDAPException(resultCode, errorMessage, msg,
op.getMatchedDN(), null);
} else
{
if(resultCode == COMPARE_FALSE)
{
if (isScriptFriendly())
{
out.println(line+": "+COMPARE_FALSE);
}
else
{
out.println(INFO_COMPARE_OPERATION_RESULT_FALSE.get(line));
}
} else if(resultCode == COMPARE_TRUE)
{
if (isScriptFriendly())
{
out.println(line+": "+COMPARE_TRUE);
}
else
{
out.println(INFO_COMPARE_OPERATION_RESULT_TRUE.get(line));
}
} else
{
Message msg = INFO_OPERATION_FAILED.get("COMPARE");
LDAPToolUtils.printErrorMessage(err, msg, resultCode, errorMessage,
op.getMatchedDN());
}
}
}
}