{"action":"created","issue":{"url":"https://api.github.com/repos/UnboundID/ldapsdk/issues/16","repository_url":"https://api.github.com/repos/UnboundID/ldapsdk","labels_url":"https://api.github.com/repos/UnboundID/ldapsdk/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/UnboundID/ldapsdk/issues/16/comments","events_url":"https://api.github.com/repos/UnboundID/ldapsdk/issues/16/events","html_url":"https://github.com/UnboundID/ldapsdk/issues/16","id":178062733,"number":16,"title":"how to create new SearchResult from the old","user":{"login":"TamasSzerb","id":296406,"avatar_url":"https://avatars.githubusercontent.com/u/296406?v=3","gravatar_id":"","url":"https://api.github.com/users/TamasSzerb","html_url":"https://github.com/TamasSzerb","followers_url":"https://api.github.com/users/TamasSzerb/followers","following_url":"https://api.github.com/users/TamasSzerb/following{/other_user}","gists_url":"https://api.github.com/users/TamasSzerb/gists{/gist_id}","starred_url":"https://api.github.com/users/TamasSzerb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TamasSzerb/subscriptions","organizations_url":"https://api.github.com/users/TamasSzerb/orgs","repos_url":"https://api.github.com/users/TamasSzerb/repos","events_url":"https://api.github.com/users/TamasSzerb/events{/privacy}","received_events_url":"https://api.github.com/users/TamasSzerb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-20T13:40:39Z","updated_at":"2016-09-20T16:58:16Z","closed_at":null,"body":"Hello,\r\n\r\nI'd like to change the implementation from the original to Paged one as https://docs.ldap.com/ldap-sdk/docs/javadoc/com/unboundid/ldap/sdk/SearchResult.html suggests.\r\n\r\nBut in many cases the code uses SearchResult, so I'd like to keep that object. I wonder how can I add more etries to it, or how to create a new one from the old.\r\n\r\ngetSearchEntries() helps, but I don't know how to construct a new one where I have to provide the SearchResult(int messageID, ResultCode resultCode, java.lang.String diagnosticMessage, java.lang.String matchedDN, java.lang.String[] referralURLs, java.util.List<SearchResultEntry> searchEntries, java.util.List<SearchResultReference> searchReferences, int numEntries, int numReferences, Control[] responseControls) \r\n\r\nand no idea where to get messageID, resultCode etc. because there are no getters in this class for them.\r\n\r\nAny suggestion is welcomed,\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/UnboundID/ldapsdk/issues/comments/248363783","html_url":"https://github.com/UnboundID/ldapsdk/issues/16#issuecomment-248363783","issue_url":"https://api.github.com/repos/UnboundID/ldapsdk/issues/16","id":248363783,"user":{"login":"dirmgr","id":12702251,"avatar_url":"https://avatars.githubusercontent.com/u/12702251?v=3","gravatar_id":"","url":"https://api.github.com/users/dirmgr","html_url":"https://github.com/dirmgr","followers_url":"https://api.github.com/users/dirmgr/followers","following_url":"https://api.github.com/users/dirmgr/following{/other_user}","gists_url":"https://api.github.com/users/dirmgr/gists{/gist_id}","starred_url":"https://api.github.com/users/dirmgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirmgr/subscriptions","organizations_url":"https://api.github.com/users/dirmgr/orgs","repos_url":"https://api.github.com/users/dirmgr/repos","events_url":"https://api.github.com/users/dirmgr/events{/privacy}","received_events_url":"https://api.github.com/users/dirmgr/received_events","type":"User","site_admin":false},"created_at":"2016-09-20T16:58:16Z","updated_at":"2016-09-20T16:58:16Z","body":"The `SearchResult` class extends `LDAPResult`, and the superclass provides methods like `getMessageID()`, `getResultCode()`, `getDiagnosticMessage()`, etc. for getting access to those elements.\r\n\r\nBut it sounds like you're thinking about creating a list with all of the search result entries returned from the server. If this might be a lot of entries, then that could require a lot of memory. One of the benefits of using the simple paged results control is that you can be sure you don't need to deal with a large number of entries all at once (and of course there are other benefits, like being able to process a search that is larger than might otherwise be allowed, or possibly to retrieve a page more than once if an error occurs).\r\n\r\nIn any place where you might have a large number of entries returned, it would probably be safer and more efficient to refactor your code so that it can handle performing the search in multiple pages. Each page will have its own `SearchResult`, so it might not even require that much refactoring beyond wrapping it in a loop."}}
{"actor":{"display_login":"dirmgr"}}