Class LdapConfiguration.ContextConfiguration
java.lang.Object
io.micronaut.security.ldap.configuration.LdapConfiguration.ContextConfiguration
- Enclosing class:
LdapConfiguration
@ConfigurationProperties("context")
public static class LdapConfiguration.ContextConfiguration
extends Object
The context configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBounds of the JNDI LDAP connection pool, applied whenisPooled()istrue. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default pooled value.static final StringThe configuration prefix. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPool()booleanisPooled()voidsetFactory(String factory) Sets the context factory class.voidsetManagerDn(String managerDn) Sets the manager DN.voidsetManagerPassword(String managerPassword) Sets the manager password.voidSets the bounds of the JNDI LDAP connection pool, applied whenisPooled()istrue.voidsetPooled(boolean pooled) Sets whether the manager context uses the JNDI LDAP connection pool (com.sun.jndi.ldap.connect.pool).voidsetProperties(Map<String, Object> properties) Any additional properties that should be passed toInitialDirContext(java.util.Hashtable).voidSets the server URL.
-
Field Details
-
PREFIX
The configuration prefix.- See Also:
-
DEFAULT_POOLED
public static final boolean DEFAULT_POOLEDThe default pooled value.- See Also:
-
-
Constructor Details
-
ContextConfiguration
public ContextConfiguration()
-
-
Method Details
-
getServer
- Returns:
- The ldap server URL
-
setServer
Sets the server URL.- Parameters:
server- The server URL
-
getManagerDn
- Returns:
- The manager DN
-
setManagerDn
Sets the manager DN.- Parameters:
managerDn- The manager DN
-
getManagerPassword
- Returns:
- The manager password
-
setManagerPassword
Sets the manager password.- Parameters:
managerPassword- The manager password
-
getFactory
- Returns:
- The context factory class
-
setFactory
Sets the context factory class. Default "com.sun.jndi.ldap.LdapCtxFactory"- Parameters:
factory- The factory class
-
isPooled
public boolean isPooled()- Returns:
- Whether the manager context uses the JNDI LDAP connection pool
- Since:
- 4.18.2
-
setPooled
public void setPooled(boolean pooled) Sets whether the manager context uses the JNDI LDAP connection pool (com.sun.jndi.ldap.connect.pool). The pool is shared by the whole JVM and, unless bounded, the JDK neither limits its size nor closes idle connections, so a burst of authentication attempts can leave the directory without free connections for user binds. When pooling is enabled, the pool is bounded withgetPool(), whose values are applied as thecom.sun.jndi.ldap.connect.pool.maxsize,com.sun.jndi.ldap.connect.pool.prefsizeandcom.sun.jndi.ldap.connect.pool.timeoutsystem properties before the first pooled connection is opened. Contexts bound with user credentials are never pooled. This is the only supported pooling switch: acom.sun.jndi.ldap.connect.poolentry in the additional context properties is ignored. Default false.- Parameters:
pooled- Whether the manager context is pooled- Since:
- 4.18.2
-
getPool
- Returns:
- The bounds of the JNDI LDAP connection pool, applied when
isPooled()istrue - Since:
- 4.18.2
-
setPool
Sets the bounds of the JNDI LDAP connection pool, applied whenisPooled()istrue.- Parameters:
pool- The pool configuration- Since:
- 4.18.2
-
getProperties
- Returns:
- Any additional properties
-
setProperties
public void setProperties(@MapFormat(transformation=FLAT,keyFormat=RAW) Map<String, Object> properties) Any additional properties that should be passed toInitialDirContext(java.util.Hashtable). Keys are bound verbatim and flat, so a key such asjava.naming.security.protocolis passed to JNDI as a single property name instead of being split into nested maps.- Parameters:
properties- The additional properties
-