Fix OPENDJ-972 - OpenDJ should set size limit to 1 when performing single entry searches
Review CR-2378
Main changes in AbstractConnection class:
* where a single entry search / read method constructs a new search request, ensure that it specifies a size limit of 1
* where a single entry search / read method is passed in a search request, check to see if it has a size limit of 1. If not, then duplicate the search request and set the size limit to 1
* detect size limit exceeded errors when processing the results of a single entry search / read : it is then transformed into a client-side error
To implement these changes :
* took into account the server error ResultCode.SIZE_LIMIT_EXCEEDED
* moved behavior for handling errors into SingleEntryHandler
* refactored SingleEntryFuture to use internally a SingleEntryHandler
* simplified searchSingleEntry method to use SingleEntryHandler
* added a new message ERR_UNEXPECTED_SEARCH_RESULT_ENTRIES_NO_COUNT to handle case where there is too many entries but without the actual number of entries
* and for tests
- added several new tests testSingleEntrySearchXXX in AbstractAsynchronousConnectionTestCase to test single entry search behavior
- added support for the client-provided handler in the internal class MockConnection of AbstractAsynchronousConnectionTestCase to better test behavior in test methods.
Also added support code for creating single entry request
* Added 2 new methods Requests#newSingleEntrySearchRequest to create single entry search requests
* Added a new method SearchRequest#isSingleEntrySearch to test if a request correspond to a single entry search
* Added a new test case class for search requests : SearchRequestTestCase