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 private
SimpleDirContextFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private DirContext
createDirContext(String securityPrincipal, char[] securityCredential, DirContextFactory.ReferralMode mode, SocketFactory socketFactory)
private SocketFactory
getSocketFactory()
DirContext
obtainDirContext(CallbackHandler handler, DirContextFactory.ReferralMode mode)
Obtain aDirContext
based on the credentials extracted from the givenCallbackHandler
.DirContext
obtainDirContext(DirContextFactory.ReferralMode mode)
Obtain aDirContext
for the configured referral mode.void
returnContext(DirContext context)
Return theDirContext
once it is no longer required.private ClassLoader
setClassLoaderTo(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:DirContextFactory
Obtain aDirContext
for the configured referral mode.- Specified by:
obtainDirContext
in interfaceDirContextFactory
- Parameters:
mode
- the referral mode for if a referral is encountered querying LDAP; the passed in referral mode can benull
in which case the default ofIGNORE
will be assumed- Returns:
- a ready to use
DirContext
for searching and attribute retrieval - Throws:
NamingException
-
obtainDirContext
public DirContext obtainDirContext(CallbackHandler handler, DirContextFactory.ReferralMode mode) throws NamingException
Description copied from interface:DirContextFactory
Obtain aDirContext
based on the credentials extracted from the givenCallbackHandler
.- Specified by:
obtainDirContext
in 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 benull
in which case the default ofIGNORE
will be assumed- Returns:
- a ready to use
DirContext
for 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:DirContextFactory
Return theDirContext
once it is no longer required. The returned DirContext is not necessarily anInitialDirContext
and as a result we can not assume it is closeable. Should only be called if a context was successfully obtained.- Specified by:
returnContext
in interfaceDirContextFactory
- Parameters:
context
- theDirContext
to return
-
setClassLoaderTo
private ClassLoader setClassLoaderTo(ClassLoader targetClassLoader)
-
-