Class SimpleDirContextFactoryBuilder.SimpleDirContextFactory
- java.lang.Object
-
- org.wildfly.security.auth.realm.ldap.SimpleDirContextFactoryBuilder.SimpleDirContextFactory
-
- All Implemented Interfaces:
DirContextFactory
- Enclosing class:
- SimpleDirContextFactoryBuilder
private class SimpleDirContextFactoryBuilder.SimpleDirContextFactory extends Object implements DirContextFactory
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.wildfly.security.auth.realm.ldap.DirContextFactory
DirContextFactory.ReferralMode
-
-
Constructor Summary
Constructors Modifier Constructor Description privateSimpleDirContextFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private DirContextcreateDirContext(String securityPrincipal, char[] securityCredential, DirContextFactory.ReferralMode mode, SocketFactory socketFactory)private SocketFactorygetSocketFactory()DirContextobtainDirContext(CallbackHandler handler, DirContextFactory.ReferralMode mode)Obtain aDirContextbased on the credentials extracted from the givenCallbackHandler.DirContextobtainDirContext(DirContextFactory.ReferralMode mode)Obtain aDirContextfor the configured referral mode.voidreturnContext(DirContext context)Return theDirContextonce it is no longer required.private ClassLoadersetClassLoaderTo(ClassLoader targetClassLoader)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.auth.realm.ldap.DirContextFactory
discardContext
-
-
-
-
Method Detail
-
obtainDirContext
public DirContext obtainDirContext(DirContextFactory.ReferralMode mode) throws NamingException
Description copied from interface:DirContextFactoryObtain aDirContextfor the configured referral mode.- Specified by:
obtainDirContextin interfaceDirContextFactory- Parameters:
mode- the referral mode for if a referral is encountered querying LDAP; the passed in referral mode can benullin which case the default ofIGNOREwill be assumed- Returns:
- a ready to use
DirContextfor searching and attribute retrieval - Throws:
NamingException
-
obtainDirContext
public DirContext obtainDirContext(CallbackHandler handler, DirContextFactory.ReferralMode mode) throws NamingException
Description copied from interface:DirContextFactoryObtain aDirContextbased on the credentials extracted from the givenCallbackHandler.- Specified by:
obtainDirContextin interfaceDirContextFactory- Parameters:
handler- the callback handler used to extract credentials in order to obtain a connected DirContext instance.mode- the referral mode for if a referral is encountered querying LDAP; the passed in referral mode can benullin which case the default ofIGNOREwill be assumed- Returns:
- a ready to use
DirContextfor searching and attribute retrieval - Throws:
NamingException
-
getSocketFactory
private SocketFactory getSocketFactory() throws NamingException
- Throws:
NamingException
-
createDirContext
private DirContext createDirContext(String securityPrincipal, char[] securityCredential, DirContextFactory.ReferralMode mode, SocketFactory socketFactory) throws NamingException
- Throws:
NamingException
-
returnContext
public void returnContext(DirContext context)
Description copied from interface:DirContextFactoryReturn theDirContextonce it is no longer required. The returned DirContext is not necessarily anInitialDirContextand as a result we can not assume it is closeable. Should only be called if a context was successfully obtained.- Specified by:
returnContextin interfaceDirContextFactory- Parameters:
context- theDirContextto return
-
setClassLoaderTo
private ClassLoader setClassLoaderTo(ClassLoader targetClassLoader)
-
-