Package org.ldaptive
Class BindConnectionInitializer
java.lang.Object
org.ldaptive.BindConnectionInitializer
- All Implemented Interfaces:
ConnectionInitializer
Initializes a connection by performing a bind operation. Useful if you need all connections to bind as the same
principal.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RequestControl[]
Bind controls.private Credential
Credential for the bind DN.private String
DN to bind as before performing operations.private SaslConfig
Configuration for bind SASL authentication.protected final org.slf4j.Logger
Logger for this class. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.BindConnectionInitializer
(String dn, String credential) Creates a new bind connection initializer.BindConnectionInitializer
(String dn, Credential credential) Creates a new bind connection initializer. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder for this class.Returns the bind controls.Returns the credential used with the bind DN.Returns the bind DN.Returns the bind sasl config.Initialize the supplied connection.boolean
isEmpty()
Returns whether this connection initializer contains any configuration data.void
setBindControls
(RequestControl... cntrls) Sets the bind controls.void
setBindCredential
(Credential credential) Sets the credential of the bind DN.void
Sets the bind DN to authenticate as before performing operations.void
setBindSaslConfig
(SaslConfig config) Sets the bind sasl config.toString()
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger for this class. -
bindDn
DN to bind as before performing operations. -
bindCredential
Credential for the bind DN. -
bindSaslConfig
Configuration for bind SASL authentication. -
bindControls
Bind controls.
-
-
Constructor Details
-
BindConnectionInitializer
public BindConnectionInitializer()Default constructor. -
BindConnectionInitializer
Creates a new bind connection initializer.- Parameters:
dn
- bind dncredential
- bind credential
-
BindConnectionInitializer
Creates a new bind connection initializer.- Parameters:
dn
- bind dncredential
- bind credential
-
-
Method Details
-
getBindDn
Returns the bind DN.- Returns:
- DN to bind as
-
setBindDn
Sets the bind DN to authenticate as before performing operations.- Parameters:
dn
- to bind as
-
getBindCredential
Returns the credential used with the bind DN.- Returns:
- bind DN credential
-
setBindCredential
Sets the credential of the bind DN.- Parameters:
credential
- to use with bind DN
-
getBindSaslConfig
Returns the bind sasl config.- Returns:
- sasl config
-
setBindSaslConfig
Sets the bind sasl config.- Parameters:
config
- sasl config
-
getBindControls
Returns the bind controls.- Returns:
- controls
-
setBindControls
Sets the bind controls.- Parameters:
cntrls
- controls to set
-
initialize
Description copied from interface:ConnectionInitializer
Initialize the supplied connection.- Specified by:
initialize
in interfaceConnectionInitializer
- Parameters:
c
- connection to initialize- Returns:
- result associated with the initialization or an empty result
- Throws:
LdapException
- if initialization fails
-
isEmpty
public boolean isEmpty()Returns whether this connection initializer contains any configuration data.- Returns:
- whether all properties are null
-
toString
-
builder
Creates a builder for this class.- Returns:
- new builder
-