Package org.ldaptive
Class BindConnectionInitializer
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.BindConnectionInitializer
- All Implemented Interfaces:
ConnectionInitializer,Freezable
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 CredentialCredential for the bind DN.private StringDN to bind as before performing operations.private SaslConfigConfiguration for bind SASL authentication.protected final LoggerLogger 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.voidfreeze()Freezes this object, making it immutable.final RequestControl[]Returns the bind controls.final CredentialReturns the credential used with the bind DN.final StringReturns the bind DN.final SaslConfigReturns the bind sasl config.Initialize the supplied connection.booleanisEmpty()Returns whether this connection initializer contains any configuration data.final voidsetBindControls(RequestControl... cntrls) Sets the bind controls.final voidsetBindCredential(Credential credential) Sets the credential of the bind DN.final voidSets the bind DN to authenticate as before performing operations.final voidsetBindSaslConfig(SaslConfig config) Sets the bind sasl config.toString()Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
Field Details
-
logger
Logger 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
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
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:ConnectionInitializerInitialize the supplied connection.- Specified by:
initializein 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
-