GitHubContribute in GitHub: Open doc issue|Edit online

LDAPSync reference in custom target project

LDAPSync is the IBM® Security Verify Directory Integrator project that provides all of the server functionality for Federated Directory Server. You must reference the LDAPSync project in your custom target project to use its functions and variables.

To define a reference to the Federated Directory Server configuration file LDAPSync.xml, complete the following steps:

  1. Right-click the References folder of the project.
  2. Select Add New Namespace.
  3. In the Namespace field, specify LDAPSync.
  4. In the URL field, specify configs/LDAPSync.xml. The sdi_solution_dir is always the current directory for IBM® Security Verify Directory Integrator. Hence, you can use relative path to reference files and folders under this location.
  5. Click Verify to confirm that IBM® Security Verify Directory Integrator can find and read the specified configuration XML file.

The LDAPSync project contains several functions and variables that simplify the creation of a custom target AssemblyLine.

LDAPSync functions

The following functions are provided:

getProperty(propName)
Use this function to retrieve configuration parameters that are set by the user in the Federated Directory Server user interface. The argument propName is the name of the property whose value is returned. A second optional argument is available, where you can specify a default value. If the named property is not found or not set, then the default value is returned if the optional argument was specified. Otherwise, a null value is returned.

connectorParam(propName)
This function is a specialized version of the getProperty() function. It has the optional second argument for a default value. However, if the named property is not defined and no default value that is provided, this function results in the standard error for missing connector parameter. You can use it when you assign properties to connector configuration settings.

logmsg(logLevel,msg)
Use this function to log messages to the log files that are associated with the running flow.

logLevel indicates the type of log messages, which can be one of the following values:

  • DEBUG
  • INFO
  • WARN
  • ERROR
  • FATAL

Use the logmsg() that is referenced from the LDAPSync project to display messages as part of the Federated Directory Server log viewing features.

initUtils()
Use this function to initialize the LDAPSync libraries. You must call this function if any of the LDAPSync features must be used in the custom target AssemblyLine, such as logging or monitoring. You can call this function in the AssemblyLine Prolog – Before Initialization hook of all custom target AssemblyLines.

sendCustomNotification()
Use this function to send notifications to the Federated Directory Server user interface.

dbgDumpEntry()
This debug function displays all opEntry attributes in alphabetical order to the log. You can use this function to control the contents of the entry object easily. For example, you can use the following script in the custom AssemblyLine to see which parameter settings are passed:

dbgDumpEntry(opEntry);

LDAPSync variables

The following global variables are available after the initUtils() function is called:

opEntry
The operational entry that is associated with the custom target AssemblyLine.

It contains all the parameter settings that are configured by using the Federated Directory Server user interface. It includes settings for the current flow, the target repository, and other Federated Directory Server features, such as monitoring and logging.

deBug
A Boolean variable that is true if the detailed log option is enabled.

flowKey
The name of the current flow that is running.