Home Contact Download
Open source connector to synchronize identities to a LDAP directory from any data source including any database with a JDBC connector, another LDAP server or flat files ...
Download  |  Read more...  |  Get started!

Synchronization Rules

Synchronization rules, also called syncOptions are defined through the lsc.syncoptions property.

This section describes synchronization rule options available. You should replace TASKNAME by a task name specified in the global configuration option lsc.tasks.

lsc.syncoptions.TASKNAME

This is the full name of the JAVA class used to provide synchronization option mechanism. For this instance of LSC, you must use the org.lsc.beans.syncoptions.PropertiesBasedSyncOptions value.

lsc.syncoptions.TASKNAME.default.action

Default action on the destination directory. Here, three values are possible :

  • K to keep data as is in the destination (means no modification at all, unless no value exists, and we create it with a create_value);
  • F for allowing modification on the data (update, create or delete), default;
  • M for merging values already in the destination directory with values from the data source.

See the matrix below for details on these options.

lsc.syncoptions.TASKNAME.<ATTRIBUTE>.create_value

Specify the value for <ATTRIBUTE> in a newly created object in the destination. Note that if present, this value will be used for <ATTRIBUTE> if it's action type is K, F or M (and if <ATTRIBUTE> is in the lsc.tasks.TASKNAME.dstService.attrs list).

This can contain a simple text value (between quotes) or a JavaScript function.

Examples:

lsc.syncoptions.TASKNAME.description.create_value = \
     "Default description for new users"
lsc.syncoptions.TASKNAME.employeeType.create_value = \
     srcBean.getAttributeValueById("type")
lsc.syncoptions.TASKNAME.uid.create_value = \
     ldap.attribute("cn=Values,o=company", "nextUidNumber")

lsc.syncoptions.TASKNAME.<ATTRIBUTE>.default_value

Specify the value for <ATTRIBUTE> in an existing entry in the destination, if it doesn't already have a value (if the action type is F and if <ATTRIBUTE> is in the lsc.tasks.TASKNAME.dstService.attrs list). This is useful for importing data into a directory that may be modified later, so that we don't overwrite it.

This can contain a simple text value (between quotes) or a JavaScript function.

Examples:

lsc.syncoptions.TASKNAME.allowAccessToHomePhone.default_value = FALSE

lsc.syncoptions.TASKNAME.<ATTRIBUTE>.force_value

Specify the value for <ATTRIBUTE> in the destination if the action type is F, regardless of existing values (if <ATTRIBUTE> is in the lsc.tasks.TASKNAME.dstService.attrs list).

This can contain a simple text value (between quotes) or a JavaScript function.

Examples:

lsc.syncoptions.TASKNAME.cn.force_value = \
     srcBean.getAttributeValueById("givenName") \
     + " " + srcBean.getAttributeValyeById("sn").toUpperCase()

delimiter - Multiple value separation

You may specify multiple values in one property, if you want to populate a multi-valued attribute. By default, values are separated by a semi-colon (;). For example:

lsc.syncoptions.TASKNAME.description.force_value = "one";"two";"three"

However, if you want, you can change the delimiter used to separate values, either for all attributes or for any given attribute, as follows:

lsc.syncoptions.TASKNAME.default.delimiter = $
lsc.syncoptions.TASKNAME.description.delimiter = $

Note: This is particularly useful if you want to write multiple JavaScript statements in a property, and need to use the semi-colon (;) to separate statements, and not values.

Functionality matrix

Depending on the action configured for an attribute, the different *_values specified and the values in the source for this attribute name, LSC's behavior varies:

Action=K Action=F Action=M
create_value If no force_value is specified, no values are read from the source, and a new entry is being added, the attribute will be created with values from create_value If no force_value is specified, and a new entry is being added, the attribute will be created with values from create_value and values from the source
default_value If no force_value is specified, no values are read from the source, and the attribute doesn't yet exist in the destination, it is created in an existing entry with values from default_value If no force_value is specified, values from default_value are added, as well as any source values, to existing destination values
force_value No changes are applied All existing values are replaced with values from force_value, regardless of values from source Values from force_value are added to existing values in the destination, regardless of values from source