You use the LDAP compare operation to make an assertion about an attribute value on an entry. Unlike the search operation, you must know the distinguished name of the entry in advance to request a compare operation. You also specify the attribute type name and the value to compare to the values stored on the entry.
Connection
has a choice of compare methods,
depending on how you set up the operation.
Check the ResultCode
from
CompareResult.getResultCode()
for
ResultCode.COMPARE_TRUE
or
ResultCode.COMPARE_FALSE
.