Class SimpleDirContextFactoryBuilder
java.lang.Object
org.wildfly.security.auth.realm.ldap.SimpleDirContextFactoryBuilder
A simple builder for a
DirContextFactory which creates new contexts on demand and disposes of them as soon as they
are returned.- Author:
- Darran Lofthouse
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build this context factory.builder()Construct a new instance.setAuthenticationContext(AuthenticationContext authenticationContext) Set the authentication context as source of security credential.setConnectionProperties(Properties connectionProperties) Set additional connection properties.setConnectTimeout(int connectTimeout) Set the timeout for connecting to the server.setCredentialSource(CredentialSource credentialSource) Set the authentication credential source.setInitialContextFactory(String initialContextFactory) Set the initial context factory class name.setModule(org.jboss.modules.Module module) Set module which will be used to load context factory and context.setProviderUrl(String providerUrl) Set the provider URL.setReadTimeout(int readTimeout) Set the read timeout for an LDAP operation.setSecurityAuthentication(String securityAuthentication) Set the security authentication method.setSecurityCredential(String securityCredential) Set the authentication credential.setSecurityPrincipal(String securityPrincipal) Set the authentication principal.setSocketFactory(SocketFactory socketFactory) Set the socket factory to be used by LDAP context.
-
Method Details
-
builder
Construct a new instance.- Returns:
- the new builder
-
setInitialContextFactory
Set the initial context factory class name.- Parameters:
initialContextFactory- the class name- Returns:
- this builder
-
setProviderUrl
Set the provider URL.- Parameters:
providerUrl- the provider URL- Returns:
- this builder
-
setSecurityAuthentication
Set the security authentication method.- Parameters:
securityAuthentication- the authentication method- Returns:
- this builder
-
setSecurityPrincipal
Set the authentication principal.- Parameters:
securityPrincipal- the principal- Returns:
- this builder
-
setSecurityCredential
Set the authentication credential. If not set, factory try to obtain it fromCredentialSourcespecified bysetCredentialSource(org.wildfly.security.credential.source.CredentialSource)of fromAuthenticationContextspecified bysetAuthenticationContext(AuthenticationContext).- Parameters:
securityCredential- the credential- Returns:
- this builder
-
setCredentialSource
Set the authentication credential source. Alternative tosetSecurityCredential(String).- Parameters:
credentialSource- the credential source- Returns:
- this builder
-
setAuthenticationContext
public SimpleDirContextFactoryBuilder setAuthenticationContext(AuthenticationContext authenticationContext) Set the authentication context as source of security credential. Alternative tosetSecurityCredential(String).- Parameters:
authenticationContext- the credential source- Returns:
- this builder
-
setSocketFactory
Set the socket factory to be used by LDAP context. Used primarily for SSL connections. If not set, factory try to obtain it fromAuthenticationContextspecified bysetAuthenticationContext(AuthenticationContext).- Parameters:
socketFactory- the socket factory- Returns:
- this builder
-
setConnectTimeout
Set the timeout for connecting to the server. Set to 0 to ensure waiting for the response infinitely. If not set, 10000 ms will be used.- Parameters:
connectTimeout- the timeout for connecting to the server in microseconds- Returns:
- this builder
-
setReadTimeout
Set the read timeout for an LDAP operation. Set to 0 to ensure waiting for the response infinitely. If not set, 60000 ms will be used.- Parameters:
readTimeout- the read timeout for an LDAP operation in microseconds- Returns:
- this builder
-
setConnectionProperties
Set additional connection properties.
- Parameters:
connectionProperties- the additional connection properties.- Returns:
- this builder
-
setModule
Set module which will be used to load context factory and context.- Parameters:
module- - module that will be used.- Returns:
- this builder
-
build
Build this context factory.- Returns:
- the context factory
-