How to remove multiple entries by a single call ?
I investigated https://docs.ldap.com/ldap-sdk/docs/javadoc/com/unboundid/ldap/sdk/DeleteRequest.html
and looks like it allows to remove only a single entry(with subtree if delete subtree control is passed).
In my use case I want to remove multiple sibling entries and it could be hundreds siblings. I don't want to make hundreds of ldap calls. Is there way to the job using a single call ?
No, there is not, at least not in standard LDAP. You can only delete a single entry at a time, unless it's a subtree and the server you're using supports the subtree delete request control.
The Ping Identity Directory Server does offer a proprietary "multi-update" extended request that allows you to request multiple add/delete/modify/modify DN/password modify requests in a single request, but I'm pretty confident that's not supported by any other type of directory server.
Your only option is likely to delete each entry individually. If you don't want to wait for the round trip time for each entry, and if there's no hierarchical relationship between the entries, then you could use the asynchronous API to send multiple requests over the same connection at the same time, or you could use the synchronous API but just have multiple threads sending requests concurrently.
Note that the LDAP SDK does come with a parallel-update command-line tool that allows you to process write operations concurrently using multiple threads. It's even got some logic in it to handle cases where there are hierarchical relationships between entries (e.g., so it won't try to delete a parent entry if there's currently an outstanding attempt to remove a child entry), and it's also got the ability to retry operations that fail in a manner that suggests they might have succeeded if they were attempted in a different order.
Your only option is likely to delete each entry individually. If you don't want to wait for the round trip time for each entry, and if there's no hierarchical relationship between the entries, then you could use the asynchronous API to send multiple requests over the same connection at the same time, or you could use the synchronous API but just have multiple threads sending requests concurrently.
I have a question about synchronous API and multiple threads. Should I use different connections? I am afraid that in case of single connection xonxurrent delete requests will be handled one by one.
That's up to you. Any real directory server should be able to concurrently process multiple requests received on the same connection (although it may impose limits on how much concurrency it will allow, but there may also be similar limits for requests on separate connections). Nevertheless, separate connections would also work just as well and probably with less contention on the network socket.