← Back to plugin index

XML File Importer Task

Description
A task that parses all XML command files found in a given input directory and manipulates the Airlock IAM DB accordingly.

Notes on error handling:

  • There is no way to roll back changes that have already been applied to the database before an error occurs.
  • How the task proceeds in case of an error can be configured with the 'Abort Import On Transformer Error' and 'General Error Handling' settings.
Type name
XmlFileImporterTask
Class
com.airlock.iam.servicecontainer.app.application.configuration.task.xmlimporter.XmlFileImporterTask
May be used by
Properties
Input Directory (inputDirectory)
Description
The directory where the command files can be read from.
Attributes
File/Path
Mandatory
Processed Directory (processedDirectory)
Description
The directory where processed command files are copied to. If processing a file has not completed - because of an external interrupt or an exception during processing - the file is moved anyway.
Attributes
File/Path
Mandatory
User Store (userStore)
Description
The user store plugin used to update user data and to import new users.
Attributes
Plugin-Link
Mandatory
Assignable plugins
Username Generator (usernameGenerator)
Description
Used for creating usernames when importing new users.
Attributes
Plugin-Link
Optional
Assignable plugins
Username Pattern (usernamePattern)
Description
If the username should be deduced from the XML attributes instead of being generated the pattern may be defined by specifying the attribute names in a shell like syntax.
Attributes
String
Optional
Example
${contractId}
Example
${givenname}.${surname}
User Not Locked Attribute (userNotLockedAttribute)
Description
One attribute in the XML UserInfo can have the special meaning of setting the user as locked in Airlock IAM. Here the attributeId of this attribute can be configured. This attribute will not any more be available for the context-data. The user is locked if an attribute with the configured name having a value other than true is present in the XML record. The feature cannot be used to unlock a locked user.
Attributes
String
Optional
Default value
valid
Example
valid
Example
active
Example
validityId
User Identifiers (userIdentifiers)
Description

This lists the UserInfo attribute names (as seen in the XML file) that are (in combination) unique to a user. So, if an existing user shares all these values with a UserInfo record, the existing user is considered to be the user in the UserInfo and the existing user is processed. If not all these attributes match, a new user is created. The id/keys are mapped to context data keys for comparison. Thus, the values must be contained in the context data container of the existing user.

Users with missing User Identifiers are skipped.

If there are multiple records with identical User Identifiers in the same XML File, the corresponding user is updated multiple times.

Attributes
String-List
Mandatory
Required User Info Attributes (requiredUserInfoAttributes)
Description

This lists the mandatory UserInfo attributes that must be present in the XML file to insert/update the user.

Users with missing Required User Info Attributes are skipped.

Attributes
String-List
Optional
User Info Mapping (userInfoMapping)
Description
The XML UserInfo/Attribute/Ids can be mapped to specific UserContextData keys. If an XML UserInfo/Attribute/Id should be added to the user's context data using the same key, you have to add an identity mapping. If no mapping for a given key is present, the key/value pair is not added to the user's context data.
Attributes
Plugin-List
Optional
Assignable plugins
Data Transformers (dataTransformers)
Description
The Data Transformers to be applied in order of definition to transform the user's context data.
Attributes
Plugin-List
Optional
Assignable plugins
Abort Import On Transformer Error (abortImportOnTransformerError)
Description
If enabled, the XML import is aborted if any of the configured Data Transformers is not able to transform an input value, possibly due to a parsing error. Otherwise the user is skipped and a warning is logged.
Attributes
Boolean
Optional
Default value
false
General Error Handling (generalErrorHandling)
Description
Defines how errors during the processing of individual users are handled.
  • Skip User and continue File Importer Task: Log the error, skip the user and continue with the remaining users.
  • Stop XML File Importer Task: Log the error and abort the task.
The following cases are covered by other error handling mechanisms and not affected by this property:
  • Users with missing 'User Identifiers' are skipped.
  • Users with missing 'Required User Info Attributes' are skipped.
  • Transformer errors are handled according to the 'Abort Import On Transformer Error' setting.
Attributes
Enum
Optional
Default value
ABORT
Token Handler Mapping (tokenHandlerMapping)
Description
Token types can be mapped to specific token handlers that know how to handle the given token type.
Attributes
Plugin-Map
Optional
Assignable plugins
File Version (fileVersion)
Description
Controls, which version of XML files will be processed. Valid values of this property are:
  • VERSION_1_0: The import file contains a single 'command' tag as root element. Only the 'updateusers' command is supported.
  • VERSION_2_0: The import file contains a single 'commands' tag as root element, which contains nested 'command' elements. 'updateusers' and 'deleteusers' commands are supported.
Attributes
Enum
Optional
Default value
VERSION_2_0
Order Passwords (orderPasswords)
Description
If enabled, the password order flag of users that are newly created during the import process is set.
Attributes
Boolean
Optional
Default value
true
Context Data Uniqueness Checks (contextDataUniquenessChecks)
Description
The context data uniqueness checks to be performed when importing user context data values.
Attributes
Plugin-List
Optional
Assignable plugins
Allow Deleting Context Data (allowDeletingContextData)
Description
If enabled, XML commands with attribute elements containing an 'xsi:nil=true' (XSD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance") attribute result in deleting the corresponding user's context data value. If not enabled, deleting context data values is generally disabled, and requests for deleting context values will be ignored.
Attributes
Boolean
Optional
Default value
false
Warn 'Deletion Skipped' (warnDeletionSkipped)
Description
If enabled, a warning is logged when a command for deleting an non-existing user is skipped.
Attributes
Boolean
Optional
Default value
true
Realm (realm)
Description
If set, every user newly created by this task is assigned to this realm. Existing users encountered by the import are left untouched (their realm is not changed). The realm name must match the pattern '^[a-zA-Z0-9_-]+$'.
Attributes
String
Optional
Example
customer-portal
YAML Template (with default values)

type: XmlFileImporterTask
id: XmlFileImporterTask-xxxxxx
displayName: 
comment: 
properties:
  abortImportOnTransformerError: false
  allowDeletingContextData: false
  contextDataUniquenessChecks:
  dataTransformers:
  fileVersion: VERSION_2_0
  generalErrorHandling: ABORT
  inputDirectory:
  orderPasswords: true
  processedDirectory:
  realm:
  requiredUserInfoAttributes:
  tokenHandlerMapping:
  userIdentifiers:
  userInfoMapping:
  userNotLockedAttribute: valid
  userStore:
  usernameGenerator:
  usernamePattern:
  warnDeletionSkipped: true