/** * Set the authentication principal. * * @param securityPrincipal the principal * @return this builder */ public SimpleDirContextFactoryBuilder setSecurityPrincipal(final String securityPrincipal) { assertNotBuilt(); this.securityPrincipal = securityPrincipal; return this; }
/** * Set module which will be used to load context factory and context. * * @param module - module that will be used. * @return this builder */ public SimpleDirContextFactoryBuilder setModule(final Module module) { assertNotBuilt(); this.targetModule = module; return this; }
/** * Set the initial context factory class name. * * @param initialContextFactory the class name * @return this builder */ public SimpleDirContextFactoryBuilder setInitialContextFactory(final String initialContextFactory) { assertNotBuilt(); this.initialContextFactory = initialContextFactory; return this; }
/** * Set the provider URL. * * @param providerUrl the provider URL * @return this builder */ public SimpleDirContextFactoryBuilder setProviderUrl(final String providerUrl) { assertNotBuilt(); this.providerUrl = providerUrl; return this; }
/** * <p>Set additional connection properties. * * @param connectionProperties the additional connection properties. * @return this builder */ public SimpleDirContextFactoryBuilder setConnectionProperties(Properties connectionProperties) { assertNotBuilt(); this.connectionProperties = connectionProperties; return this; }
/** * Set the authentication credential source. * Alternative to {@link #setSecurityCredential(String)}. * * @param credentialSource the credential source * @return this builder */ public SimpleDirContextFactoryBuilder setCredentialSource(final CredentialSource credentialSource) { assertNotBuilt(); this.credentialSource = credentialSource; return this; }
/** * Set the authentication context as source of security credential. * Alternative to {@link #setSecurityCredential(String)}. * * @param authenticationContext the credential source * @return this builder */ public SimpleDirContextFactoryBuilder setAuthenticationContext(final AuthenticationContext authenticationContext) { assertNotBuilt(); this.authenticationContext = authenticationContext; return this; }
/** * Set the security authentication method. * * @param securityAuthentication the authentication method * @return this builder */ public SimpleDirContextFactoryBuilder setSecurityAuthentication(final String securityAuthentication) { assertNotBuilt(); this.securityAuthentication = securityAuthentication; return this; }
/** * Set the timeout for connecting to the server. * Set to 0 to ensure waiting for the response infinitely. * If not set, {@value #DEFAULT_CONNECT_TIMEOUT} ms will be used. * * @param connectTimeout the timeout for connecting to the server in microseconds * @return this builder */ public SimpleDirContextFactoryBuilder setConnectTimeout(int connectTimeout) { assertNotBuilt(); this.connectTimeout = connectTimeout; return this; }
/** * Set the read timeout for an LDAP operation. * Set to 0 to ensure waiting for the response infinitely. * If not set, {@value #DEFAULT_READ_TIMEOUT} ms will be used. * * @param readTimeout the read timeout for an LDAP operation in microseconds * @return this builder */ public SimpleDirContextFactoryBuilder setReadTimeout(int readTimeout) { assertNotBuilt(); this.readTimeout = readTimeout; return this; }
/** * Set the authentication credential. * If not set, factory try to obtain it from {@link CredentialSource} specified by * {@link #setCredentialSource(org.wildfly.security.credential.source.CredentialSource)} of from * {@link AuthenticationContext} specified by {@link #setAuthenticationContext(AuthenticationContext)}. * * @param securityCredential the credential * @return this builder */ public SimpleDirContextFactoryBuilder setSecurityCredential(final String securityCredential) { assertNotBuilt(); this.securityCredential = securityCredential; return this; }
/** * Set the socket factory to be used by LDAP context. * Used primarily for SSL connections. * * If not set, factory try to obtain it from {@link AuthenticationContext} specified by {@link #setAuthenticationContext(AuthenticationContext)}. * * @param socketFactory the socket factory * @return this builder */ public SimpleDirContextFactoryBuilder setSocketFactory(final SocketFactory socketFactory) { assertNotBuilt(); this.socketFactory = socketFactory; return this; }
/** * Build this context factory. * * @return the context factory */ public DirContextFactory build() { assertNotBuilt(); if (providerUrl == null) { throw log.noProviderUrlSet(); } if(this.targetModule != null){ if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.doChecked(new GetModuleClassLoaderAction(this.targetModule)); } else { this.targetClassLoader = this.targetModule.getClassLoader(); } } else { if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.getClassLoaderPrivileged(this.getClass()); } else { this.targetClassLoader = this.getClass().getClassLoader(); } } built = true; return new SimpleDirContextFactory(); }
/** * <p>Set additional connection properties. * * @param connectionProperties the additional connection properties. * @return this builder */ public SimpleDirContextFactoryBuilder setConnectionProperties(Properties connectionProperties) { assertNotBuilt(); this.connectionProperties = connectionProperties; return this; }
/** * Set the security authentication method. * * @param securityAuthentication the authentication method * @return this builder */ public SimpleDirContextFactoryBuilder setSecurityAuthentication(final String securityAuthentication) { assertNotBuilt(); this.securityAuthentication = securityAuthentication; return this; }
/** * Set the authentication context as source of security credential. * Alternative to {@link #setSecurityCredential(String)}. * * @param authenticationContext the credential source * @return this builder */ public SimpleDirContextFactoryBuilder setAuthenticationContext(final AuthenticationContext authenticationContext) { assertNotBuilt(); this.authenticationContext = authenticationContext; return this; }
/** * Set the provider URL. * * @param providerUrl the provider URL * @return this builder */ public SimpleDirContextFactoryBuilder setProviderUrl(final String providerUrl) { assertNotBuilt(); this.providerUrl = providerUrl; return this; }
/** * Set the security authentication method. * * @param securityAuthentication the authentication method * @return this builder */ public SimpleDirContextFactoryBuilder setSecurityAuthentication(final String securityAuthentication) { assertNotBuilt(); this.securityAuthentication = securityAuthentication; return this; }
/** * Set the authentication principal. * * @param securityPrincipal the principal * @return this builder */ public SimpleDirContextFactoryBuilder setSecurityPrincipal(final String securityPrincipal) { assertNotBuilt(); this.securityPrincipal = securityPrincipal; return this; }
/** * Set the authentication credential source. * Alternative to {@link #setSecurityCredential(String)}. * * @param credentialSource the credential source * @return this builder */ public SimpleDirContextFactoryBuilder setCredentialSource(final CredentialSource credentialSource) { assertNotBuilt(); this.credentialSource = credentialSource; return this; }