Package org.linphone.core

# Interface LdapParams

public interface LdapParams
Object that is used to set the different parameters of a `Ldap`.

## Method Summary

Modifier and Type
Method
Description
`int`
`check()`
Check parameters and return what are wrong.
`LdapParams`
`clone()`
Instantiate a new `LdapParams` with values from source.
`Ldap.AuthMethod`
`getAuthMethod()`
Get the authentification method.
`String`
`getBaseObject()`
Get the BaseObject.
`String`
`getBindDn()`
Get the Bind DN to use for bindings.
`String`
`getCustomValue(String key)`
Get the value from field.
`Ldap.DebugLevel`
`getDebugLevel()`
Return the debug verbosity level.
`int`
`getDelay()`
Deprecated.
`boolean`
`getEnabled()`
Deprecated.
`String`
`getFilter()`
Get the search is based on this filter to search contacts.
`int`
`getMaxResults()`
Deprecated.
`int`
`getMinChars()`
Deprecated.
`String`
`getNameAttribute()`
Get the list of LDAP attributes to check for the contact name, separated by a
comma and the first being the highest priority.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`String`
`getPassword()`
Get the password to pass to server when binding.
`String`
`getServer()`
Deprecated.
`Ldap.CertVerificationMode`
`getServerCertificatesVerificationMode()`
Return whether the tls server certificate must be verified when connecting to a
LDAP server.
`String`
`getSipAttribute()`
Get the attributes to build the SIP username in address of Friend.
`String`
`getSipDomain()`
Get the domain to the sip address(sip:username@domain).
`int`
`getTimeout()`
Deprecated.
`int`
`getTimeoutTlsMs()`
Get the timeout for TLS connection in milliseconds.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`boolean`
`isSalEnabled()`
Handle the DNS resolution using liblinphone's own resolver, which allows to use
DNS SRV records.
`boolean`
`isTlsEnabled()`
Return if transactions are encrypted by LDAP over TLS(StartTLS).
`void`
`setAuthMethod(Ldap.AuthMethod authMethod)`
Authentification method.
`void`
`setBaseObject(String baseObject)`
BaseObject is a specification for LDAP Search Scopes that specifies that the
Search Request should only be performed against the entry specified as the
search base DN.
`void`
`setBindDn(String bindDn)`
Bind DN to use for bindings.
`void`
`setCustomValue(String key, String value)`
Set custom field.
`void`
`setDebugLevel(Ldap.DebugLevel level)`
The debug verbosity level from internal LDAP API.
`void`
`setDelay(int delay)`
Deprecated.
`void`
`setEnabled(boolean enable)`
Deprecated.
`void`
`setFilter(String filter)`
The search is based on this filter to search contacts.
`void`
`setMaxResults(int maxResults)`
Deprecated.
`void`
`setMinChars(int minChars)`
Deprecated.
`void`
`setNameAttribute(String nameAttribute)`
List of LDAP attributes to check for the contact name, separated by a comma and
the first being the highest priority.
`void`
`setPassword(String password)`
The password to pass to server when binding.
`void`
`setSalEnabled(boolean enable)`
Handle the DNS resolution using liblinphone's own resolver, which allows to use
DNS SRV records.
`void`
`setServer(String server)`
Deprecated.
`void`
`setServerCertificatesVerificationMode(Ldap.CertVerificationMode verifyServerCertificates)`
Specify whether the tls server certificate must be verified when connecting to
a LDAP server.
`void`
`setSipAttribute(String sipAttribute)`
Check these attributes to build the SIP username in address of Friend.
`void`
`setSipDomain(String sipDomain)`
Add the domain to the sip address(sip:username@domain).
`void`
`setTimeout(int timeout)`
Deprecated.
`void`
`setTimeoutTlsMs(int timeout)`
Timeout for TLS connection in milliseconds.
`void`
`setTlsEnabled(boolean enable)`
Encrypt transactions by LDAP over TLS(StartTLS).
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`

## Method Details

### getAuthMethod

Ldap.AuthMethod getAuthMethod()
Get the authentification method.
Check
invalid reference

    Ldap#AuthMethod

for authentification values.

Returns:
  The
  invalid reference

      Ldap#AuthMethod

  .

### setAuthMethod

void setAuthMethod(Ldap.AuthMethod authMethod)
Authentification method.
Check
invalid reference

    Ldap#AuthMethod

for authentification values. Default value :
LinphoneLdapAuthMethodSimple

Parameters:
  `authMethod` - The
  invalid reference

      Ldap#AuthMethod

  .

### getBaseObject

String getBaseObject()
Get the BaseObject.
It is a specification for LDAP Search Scopes that specifies that the Search
Request should only be performed against the entry specified as the search base
DN. No entries above it will be considered. This field is required.

Returns:
  The specification.

### setBaseObject

void setBaseObject(String baseObject)
BaseObject is a specification for LDAP Search Scopes that specifies that the
Search Request should only be performed against the entry specified as the
search base DN.
No entries above it will be considered. This field is required. Default value :
"dc=example,dc=com"

Parameters:
  `baseObject` - The specification.

### getBindDn

String getBindDn()
Get the Bind DN to use for bindings.
The bindDN DN is the credential that is used to authenticate against an LDAP.
If empty, the connection will be Anonymous. eg:
cn=ausername,ou=people,dc=bc,dc=com

Returns:
  The Bind DN to use for bindings.

### setBindDn

void setBindDn(String bindDn)
Bind DN to use for bindings.
The bindDN DN is the credential that is used to authenticate against an LDAP.
If empty, the connection will be Anonymous. eg:
cn=ausername,ou=people,dc=bc,dc=com Default value : "".

Parameters:
  `bindDn` - The Bind DN to use for bindings.

### getDebugLevel

Ldap.DebugLevel getDebugLevel()
Return the debug verbosity level.

Returns:
  The
  invalid reference

      Ldap#DebugLevel

  debug level.

### setDebugLevel

void setDebugLevel(Ldap.DebugLevel level)
The debug verbosity level from internal LDAP API.
Values are
invalid reference

    Ldap#DebugLevel

Default value: LinphoneLdapDebugLevelOff

Parameters:
  `level` - The
  invalid reference

      Ldap#DebugLevel

  debug level.

### getDelay

@Deprecated int getDelay()
Deprecated.
Get the delay between each search in milliseconds.
deprecated: 22/08/2025 use `RemoteContactDirectory.getDelay()` instead.

Returns:
  The delay in milliseconds.

### setDelay

@Deprecated void setDelay(int delay)
Deprecated.
Delay between each search in milliseconds Default value : 500.

Parameters:
  `delay` - The timeout in milliseconds.
  deprecated: 22/08/2025 use `RemoteContactDirectory.setDelay(int)` instead.

### getEnabled

@Deprecated boolean getEnabled()
Deprecated.
Return if the configuration is enabled.

Returns:
  Enable or not the LDAP configuration.
  deprecated: 22/08/2025 Use `RemoteContactDirectory.enabled()` instead.

### setEnabled

@Deprecated void setEnabled(boolean enable)
Deprecated.
If this config is enabled.
Default value : false.

Parameters:
  `enable` - Enable or not the LDAP configuration.
  deprecated: 22/08/2025 Use `RemoteContactDirectory.enable(boolean)` instead.

### getFilter

String getFilter()
Get the search is based on this filter to search contacts.

Returns:
  The filter to use.

### setFilter

void setFilter(String filter)
The search is based on this filter to search contacts.
Default value : "(sn=*%s*)".

Parameters:
  `filter` - The filter to use.

### getMaxResults

@Deprecated int getMaxResults()
Deprecated.
Get the max results when requesting searches.
0 means the results aren't limited (but magic search limitation may apply).

Returns:
  The max results when requesting searches.
  deprecated: 18/11/2024 use `RemoteContactDirectory.getLimit()` instead.

### setMaxResults

@Deprecated void setMaxResults(int maxResults)
Deprecated.
The max results when requesting searches.
Default value : 5. This value fit for standard cases where only first results
are needed. Also, it avoids latency on each searchs. Set this value to 0 to
have an unlimited search (but magic search limitation may apply).

Parameters:
  `maxResults` - The max results when requesting searches.
  deprecated: 18/11/2024 use `RemoteContactDirectory.setLimit(int)` instead.

### getMinChars

@Deprecated int getMinChars()
Deprecated.
Get the minimum characters needed for doing a search on LDAP servers.

Returns:
  The minimum characters needed by a search.
  deprecated: 18/11/2024 use `RemoteContactDirectory.getMinCharacters()`
  instead.

### setMinChars

@Deprecated void setMinChars(int minChars)
Deprecated.
The minimum characters needed for doing a search on LDAP servers.
Default value : 0.

Parameters:
  `minChars` - The minimum characters needed by a search.
  deprecated: 18/11/2024 use `RemoteContactDirectory.setMinCharacters(int)`
  instead.

### getNameAttribute

String getNameAttribute()
Get the list of LDAP attributes to check for the contact name, separated by a
comma and the first being the highest priority.

Returns:
  The comma separated attributes for the search.

### setNameAttribute

void setNameAttribute(String nameAttribute)
List of LDAP attributes to check for the contact name, separated by a comma and
the first being the highest priority.
Default value : "sn".

Parameters:
  `nameAttribute` - The comma separated attributes for the search.

### getPassword

String getPassword()
Get the password to pass to server when binding.

Returns:
  The password to pass to server when binding.

### setPassword

void setPassword(String password)
The password to pass to server when binding.
Default value : "".

Parameters:
  `password` - The password to pass to server when binding.

### isSalEnabled

boolean isSalEnabled()
Handle the DNS resolution using liblinphone's own resolver, which allows to use
DNS SRV records.

Returns:
  whether liblinphone'own DNS resolver is used.

### setSalEnabled

void setSalEnabled(boolean enable)
Handle the DNS resolution using liblinphone's own resolver, which allows to use
DNS SRV records.
Default value : true.

Parameters:
  `enable` - Enable or not the use of own DNS resolver.

### getServer

@Deprecated String getServer()
Deprecated.
Get the LDAP Server.

Returns:
  LDAP Server address.
  deprecated: 18/11/2024 use `RemoteContactDirectory.getServerUrl()` instead.

### setServer

@Deprecated void setServer(String server)
Deprecated.
LDAP Server.
eg: ldap:/// for a localhost server or ldap://ldap.example.org/ Default value:
"ldap:///". This field is required.
You must use 'ldap' scheme. 'ldaps' for LDAP over SSL is non-standardized and
deprecated.

Parameters:
  `server` - LDAP Server address.
  deprecated: 18/11/2024 use `RemoteContactDirectory.setServerUrl(java.lang.String)` instead.

### getServerCertificatesVerificationMode

Ldap.CertVerificationMode getServerCertificatesVerificationMode()
Return whether the tls server certificate must be verified when connecting to a
LDAP server.

Returns:
  The TLS verification mode from
  invalid reference

      Ldap#CertVerificationMode

### setServerCertificatesVerificationMode

void setServerCertificatesVerificationMode(Ldap.CertVerificationMode verifyServerCertificates)
Specify whether the tls server certificate must be verified when connecting to
a LDAP server.
Values are
invalid reference

    Ldap#CertVerificationMode

Default value :
LinphoneLdapCertVerificationDefault (auto)

Parameters:
  `verifyServerCertificates` - The TLS verification mode from
  invalid reference

      Ldap#CertVerificationMode

### getSipAttribute

String getSipAttribute()
Get the attributes to build the SIP username in address of Friend.
Attributes are separated by a comma.

Returns:
  The comma separated attributes for building Friend.

### setSipAttribute

void setSipAttribute(String sipAttribute)
Check these attributes to build the SIP username in address of Friend.
Attributes are separated by a comma. Default value :
"mobile,telephoneNumber,homePhone,sn".

Parameters:
  `sipAttribute` - The comma separated attributes for building Friend.

### getSipDomain

String getSipDomain()
Get the domain to the sip address(sip:username@domain).

Returns:
  The SIP domain for the friend.

### setSipDomain

void setSipDomain(String sipDomain)
Add the domain to the sip address(sip:username@domain).
By default or if it is empty, the domain will be specify while searching on the
current proxy account. Default value : "".

Parameters:
  `sipDomain` - The SIP domain for the friend.

### getTimeout

@Deprecated int getTimeout()
Deprecated.
Get the timeout for requests in seconds.

Returns:
  The timeout in seconds.
  deprecated: 18/11/2024 use `RemoteContactDirectory.getTimeout()` instead.

### setTimeout

@Deprecated void setTimeout(int timeout)
Deprecated.
Timeout for requests in seconds.
It limits the time for searchs and the value is passed to Ldap with
LDAP_OPT_NETWORK_TIMEOUT. Default value : 5.
It limits the time for searchs and the value is passed to Ldap with
LDAP_OPT_NETWORK_TIMEOUT. Default value : 5.

Parameters:
  `timeout` - The timeout in seconds.
  deprecated: 18/11/2024 use `RemoteContactDirectory.setTimeout(int)` instead.

### getTimeoutTlsMs

int getTimeoutTlsMs()
Get the timeout for TLS connection in milliseconds.

Returns:
  The timeout in milliseconds.

### setTimeoutTlsMs

void setTimeoutTlsMs(int timeout)
Timeout for TLS connection in milliseconds.
Default value : 1000.

Parameters:
  `timeout` - The timeout in milliseconds.

### isTlsEnabled

boolean isTlsEnabled()
Return if transactions are encrypted by LDAP over TLS(StartTLS).
You must use \'ldap\' scheme. \'ldaps\' for LDAP over SSL is non-standardized
and deprecated. StartTLS in an extension to the LDAP protocol which uses the
TLS protocol to encrypt communication. It works by establishing a normal - i.e.
unsecured - connection with the LDAP server before a handshake negotiation
between the server and the web services is carried out. Here, the server sends
its certificate to prove its identity before the secure connection is
established.

Returns:
  Enable or not the use of TLS.

### setTlsEnabled

void setTlsEnabled(boolean enable)
Encrypt transactions by LDAP over TLS(StartTLS).
You must use 'ldap' scheme. 'ldaps' for LDAP over SSL is non-standardized and
deprecated. StartTLS in an extension to the LDAP protocol which uses the TLS
protocol to encrypt communication. It works by establishing a normal - i.e.
unsecured - connection with the LDAP server before a handshake negotiation
between the server and the web services is carried out. Here, the server sends
its certificate to prove its identity before the secure connection is
established. Default value : true.

Parameters:
  `enable` - Enable or not the use of TLS.

### check

int check()
Check parameters and return what are wrong.

Returns:
  The
  invalid reference

      Ldap#Check

  values. LinphoneLdapCheckOk if everything is ok.

### clone

LdapParams clone()
Instantiate a new `LdapParams` with values from source.

Returns:
  The newly created `LdapParams` object.

### getCustomValue

String getCustomValue(String key)
Get the value from field.

Parameters:
  `key` - The key string.
Returns:
  The Value associated to the key.

### setCustomValue

void setCustomValue(String key, String value)
Set custom field.

Parameters:
  `key` - The key string.
  `value` - The value string.

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`