public DelegatingLdapContext wrapReferralContextObtaining(ReferralException e) throws NamingException { ClassLoader previous = setSocketFactory(); try { return new DelegatingLdapContext((DirContext) e.getReferralContext(), socketFactory); } finally { unsetSocketFactory(previous); } }
@Override public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException { return wrap(delegating.search(name, matchingAttributes, attributesToReturn)); }
private ClassLoader setSocketFactory() { if (socketFactory != null) { ThreadLocalSSLSocketFactory.set(socketFactory); return setClassLoaderTo(getSocketFactoryClassLoader()); } return null; }
public LdapContext newInitialLdapContext(Hashtable<?,?> environment, Control[] connCtls) throws NamingException { ClassLoader previous = setSocketFactory(); try { return new InitialLdapContext(environment, null); } finally { unsetSocketFactory(previous); } }
@Override public LdapContext newInstance(Control[] requestControls) throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); LdapContext newContext = ((LdapContext) delegating).newInstance(requestControls); return new DelegatingLdapContext(newContext, socketFactory); }
userContext = ((DelegatingLdapContext) dirContext).newInitialLdapContext(props, null); } else { userContext = new InitialLdapContext(props, null);
private void unsetSocketFactory(ClassLoader previous) { if (socketFactory != null) { ThreadLocalSSLSocketFactory.unset(); setClassLoaderTo(previous); } }
@Override public void reconnect(Control[] controls) throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); ClassLoader previous = setSocketFactory(); try { ((LdapContext) delegating).reconnect(controls); } finally { unsetSocketFactory(previous); } }
return new DelegatingLdapContext(initialContext, this::returnContext, socketFactory); } finally{ setClassLoaderTo(oldClassLoader);
userContext = ((DelegatingLdapContext) dirContext).newInitialLdapContext(props, null); } else { userContext = new InitialLdapContext(props, null);
private void unsetSocketFactory(ClassLoader previous) { if (socketFactory != null) { ThreadLocalSSLSocketFactory.unset(); setClassLoaderTo(previous); } }
@Override public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException { return wrap(delegating.search(name, matchingAttributes, attributesToReturn)); }
public DelegatingLdapContext wrapReferralContextObtaining(ReferralException e) throws NamingException { ClassLoader previous = setSocketFactory(); try { return new DelegatingLdapContext((DirContext) e.getReferralContext(), socketFactory); } finally { unsetSocketFactory(previous); } }
public LdapContext newInitialLdapContext(Hashtable<?,?> environment, Control[] connCtls) throws NamingException { ClassLoader previous = setSocketFactory(); try { return new InitialLdapContext(environment, null); } finally { unsetSocketFactory(previous); } }
@Override public LdapContext newInstance(Control[] requestControls) throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); LdapContext newContext = ((LdapContext) delegating).newInstance(requestControls); return new DelegatingLdapContext(newContext, socketFactory); }
private ClassLoader setSocketFactory() { if (socketFactory != null) { ThreadLocalSSLSocketFactory.set(socketFactory); return setClassLoaderTo(getSocketFactoryClassLoader()); } return null; }
userContext = ((DelegatingLdapContext) dirContext).newInitialLdapContext(props, null); } else { userContext = new InitialLdapContext(props, null);
private void unsetSocketFactory(ClassLoader previous) { if (socketFactory != null) { ThreadLocalSSLSocketFactory.unset(); setClassLoaderTo(previous); } }
@Override public NamingEnumeration<SearchResult> search(String name, String filter, SearchControls cons) throws NamingException { return wrap(delegating.search(name, filter, cons)); }
public DelegatingLdapContext wrapReferralContextObtaining(ReferralException e) throws NamingException { ClassLoader previous = setSocketFactory(); try { return new DelegatingLdapContext((DirContext) e.getReferralContext(), socketFactory); } finally { unsetSocketFactory(previous); } }