/** * Create a DirContext using the supplied environment. * * @param environment the LDAP environment to use when creating the * <code>DirContext</code>. * @return a new DirContext implementation initialized with the supplied * environment. */ protected DirContext createContext(Hashtable<String, Object> environment) { DirContext ctx = null; try { ctx = getDirContextInstance(environment); if (LOG.isInfoEnabled()) { Hashtable<?, ?> ctxEnv = ctx.getEnvironment(); String ldapUrl = (String) ctxEnv.get(Context.PROVIDER_URL); LOG.debug("Got Ldap context on server '" + ldapUrl + "'"); } return ctx; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }
/** * Create a DirContext using the supplied environment. * * @param environment the LDAP environment to use when creating the * <code>DirContext</code>. * @return a new DirContext implementation initialized with the supplied * environment. */ protected DirContext createContext(Hashtable<String, Object> environment) { DirContext ctx = null; try { ctx = getDirContextInstance(environment); if (LOG.isInfoEnabled()) { Hashtable<?, ?> ctxEnv = ctx.getEnvironment(); String ldapUrl = (String) ctxEnv.get(Context.PROVIDER_URL); LOG.debug("Got Ldap context on server '" + ldapUrl + "'"); } return ctx; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }
/** * Create a DirContext using the supplied environment. * * @param environment the LDAP environment to use when creating the * <code>DirContext</code>. * @return a new DirContext implementation initialized with the supplied * environment. */ protected DirContext createContext(Hashtable<String, Object> environment) { DirContext ctx = null; try { ctx = getDirContextInstance(environment); if (LOG.isInfoEnabled()) { Hashtable<?, ?> ctxEnv = ctx.getEnvironment(); String ldapUrl = (String) ctxEnv.get(Context.PROVIDER_URL); LOG.debug("Got Ldap context on server '" + ldapUrl + "'"); } return ctx; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }
/** * Create a DirContext using the supplied environment. * * @param environment the LDAP environment to use when creating the * <code>DirContext</code>. * @return a new DirContext implementation initialized with the supplied * environment. */ protected DirContext createContext(Hashtable<String, Object> environment) { DirContext ctx = null; try { ctx = getDirContextInstance(environment); if (LOG.isInfoEnabled()) { Hashtable<?, ?> ctxEnv = ctx.getEnvironment(); String ldapUrl = (String) ctxEnv.get(Context.PROVIDER_URL); LOG.debug("Got Ldap context on server '" + ldapUrl + "'"); } return ctx; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }
private DirContext doGetContext(String principal, String credentials, boolean explicitlyDisablePooling) { Hashtable<String, Object> env = getAuthenticatedEnv(principal, credentials); if(explicitlyDisablePooling) { env.remove(SUN_LDAP_POOLING_FLAG); } DirContext ctx = createContext(env); try { DirContext processedDirContext = authenticationStrategy.processContextAfterCreation(ctx, principal, credentials); return processedDirContext; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }
private DirContext doGetContext(String principal, String credentials, boolean explicitlyDisablePooling) { Hashtable<String, Object> env = getAuthenticatedEnv(principal, credentials); if(explicitlyDisablePooling) { env.remove(SUN_LDAP_POOLING_FLAG); } DirContext ctx = createContext(env); try { DirContext processedDirContext = authenticationStrategy.processContextAfterCreation(ctx, principal, credentials); return processedDirContext; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }
private DirContext doGetContext(String principal, String credentials, boolean explicitlyDisablePooling) { Hashtable<String, Object> env = getAuthenticatedEnv(principal, credentials); if(explicitlyDisablePooling) { env.remove(SUN_LDAP_POOLING_FLAG); } DirContext ctx = createContext(env); try { DirContext processedDirContext = authenticationStrategy.processContextAfterCreation(ctx, principal, credentials); return processedDirContext; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }
private DirContext doGetContext(String principal, String credentials, boolean explicitlyDisablePooling) { Hashtable<String, Object> env = getAuthenticatedEnv(principal, credentials); if(explicitlyDisablePooling) { env.remove(SUN_LDAP_POOLING_FLAG); } DirContext ctx = createContext(env); try { DirContext processedDirContext = authenticationStrategy.processContextAfterCreation(ctx, principal, credentials); return processedDirContext; } catch (NamingException e) { closeContext(ctx); throw LdapUtils.convertLdapException(e); } }