public SearchResult getLdapSearchResult(String username, String password,
Element rootElement, boolean bindRequired) throws NamingException {
String className = UtilXml.childElementValue(rootElement, "CasLdapHandler", "org.ofbiz.ldap.openldap.OFBizLdapAuthenticationHandler");
try {
Class<?> handlerClass = Class.forName(className);
InterfaceOFBizAuthenticationHandler casLdapHandler = (InterfaceOFBizAuthenticationHandler) handlerClass.newInstance();
return casLdapHandler.getLdapSearchResult(username, password, rootElement, bindRequired);
} catch (ClassNotFoundException e) {
throw new NamingException(e.getLocalizedMessage());
} catch (InstantiationException e) {
throw new NamingException(e.getLocalizedMessage());
} catch (IllegalAccessException e) {