This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
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.