Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
No announcement yet.
SimpleLdapTemplate.lookup with a Name parameterPage Title Module
Actually, we were trying to keep the number of method signatures in SimpleLdapTemplate at a minimum, in order to make it as concise as possible. Leaving methods that take a 'Name' parameter out of there was a conscious decision, as was leaving the ones the take an AttributesMapper.
Adding the requested method would basically require us to add all the other mirrored methods that take a 'Name' parameter, cluttering the interface, so I don't think we will be doing that. Feel free to add a jira issue however, and if there is lots of support for it we might reconsider.
That's a shame. I'm kind of stuck between a rock and a hard place. If I want to take advantage of Java 5's advanced features (and I do) I should use SimpleLdapTemplate, but since it doesn't support the code I already have in place, it isn't really a drop in LdapTemplate replacement, which is what I would have expected for something with that name.
I decided not to use SimpleLdapTemplate because it didn't support what I needed, so now it's back to casting.
Once again, SimpleLdapTemplate is not intended as a drop-in replacement for all usages of LdapTemplate, but rather as a simplified substitute to be used for the most common cases. I don't think the problems are as serious as you make them; all you need to do is toString() on your Name and you're all set.
Also, if this is very important for you there is nothing that prevents you from subclassing SimpleLdapTemplate in your project and implementing the requested lookup method there.