Interface LdapParams


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

  • Method Details

    • getAuthMethod

      Ldap.AuthMethod getAuthMethod()
      Get the authentification method.

      Check Ldap#AuthMethod for authentification values.
      Returns:
      The Ldap#AuthMethod.
    • setAuthMethod

      void setAuthMethod(Ldap.AuthMethod authMethod)
      Authentification method.

      Check Ldap#AuthMethod for authentification values. Default value :
      LinphoneLdapAuthMethodSimple
      Parameters:
      authMethod - The Ldap#AuthMethod.
    • getBaseObject

      @NonNull 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(@NonNull 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

      @Nullable 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(@Nullable 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 Ldap#DebugLevel debug level.
    • setDebugLevel

      void setDebugLevel(Ldap.DebugLevel level)
      The debug verbosity level from internal LDAP API.

      Values are Ldap#DebugLevel Default value: LinphoneLdapDebugLevelOff
      Parameters:
      level - The Ldap#DebugLevel debug level.
    • getDelay

      int getDelay()
      Get the delay between each search in milliseconds.

      Returns:
      The delay in milliseconds.
    • setDelay

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

      Parameters:
      delay - The timeout in milliseconds.
    • getEnabled

      boolean getEnabled()
      Return if the configuration is enabled.

      Returns:
      Enable or not the LDAP configuration.
    • setEnabled

      void setEnabled(boolean enable)
      If this config is enabled.

      Default value : false.
      Parameters:
      enable - Enable or not the LDAP configuration.
    • getFilter

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

      Returns:
      The filter to use.
    • setFilter

      void setFilter(@Nullable String filter)
      The search is based on this filter to search contacts.

      Default value : "(sn=*%s*)".
      Parameters:
      filter - The filter to use.
    • getMaxResults

      int getMaxResults()
      Get the max results when requesting searches.

      Returns:
      The max results when requesting searches.
    • setMaxResults

      void setMaxResults(int maxResults)
      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.
      Parameters:
      maxResults - The max results when requesting searches.
    • getMinChars

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

      Returns:
      The minimum characters needed by a search.
    • setMinChars

      void setMinChars(int minChars)
      The minimum characters needed for doing a search on LDAP servers.

      Default value : 0.
      Parameters:
      minChars - The minimum characters needed by a search.
    • getNameAttribute

      @Nullable String getNameAttribute()
      Get the attributes to build Name Friend, separated by a comma and the first is
      the highest priority.

      Returns:
      The comma separated attributes for the search.
    • setNameAttribute

      void setNameAttribute(@Nullable String nameAttribute)
      Check these attributes to build Name Friend, separated by a comma and the first
      is the highest priority.

      Default value : "sn".
      Parameters:
      nameAttribute - The comma separated attributes for the search.
    • getPassword

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

      Returns:
      The password to pass to server when binding.
    • setPassword

      void setPassword(@Nullable 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()
      Return if the dns resolution is done by Linphone using Sal.

      It will pass an IP to LDAP. By doing that, the TLS negociation could not check
      the hostname. You may deactivate the verifications if wanted to force the
      connection.
      Returns:
      Enable or not the use of sal.
    • setSalEnabled

      void setSalEnabled(boolean enable)
      The dns resolution is done by Linphone using Sal.

      It will pass an IP to LDAP. By doing that, the TLS negociation could not check
      the hostname. You may deactivate the verifications if wanted to force the
      connection. Default value : false.
      Parameters:
      enable - Enable or not the use of sal.
    • getServer

      @NonNull String getServer()
      Get the LDAP Server.

      Returns:
      LDAP Server address.
    • setServer

      void setServer(@NonNull String server)
      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.
    • 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 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 Ldap#CertVerificationMode Default value :
      LinphoneLdapCertVerificationDefault (auto)
      Parameters:
      verifyServerCertificates - The TLS verification mode from Ldap#CertVerificationMode
    • getSipAttribute

      @Nullable 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(@Nullable 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

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

      Returns:
      The SIP domain for the friend.
    • setSipDomain

      void setSipDomain(@Nullable 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

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

      Returns:
      The timeout in seconds.
    • setTimeout

      void setTimeout(int timeout)
      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.
      Parameters:
      timeout - The timeout in seconds.
    • 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 Ldap#Check values. LinphoneLdapCheckOk if everything is ok.
    • clone

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

      Returns:
      The newly created LdapParams object.
    • getCustomValue

      @Nullable String getCustomValue(@NonNull String key)
      Get the value from field.

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

      void setCustomValue(@NonNull String key, @Nullable 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