Note: this component stores cluster-wide configuration data and is mirrored across all servers in the topology within the the same cluster.
Note: changes to cluster-wide configuration objects are immediately and automatically mirrored across all servers within the same cluster, so offline changes are not supported.
A constructed attribute constructs values for an attribute by using a combination of fixed text and values of other attributes from the entry. Note that just creating one of these objects will not have any effect. The object must be referenced from another configuration object such as a Delegated Admin Resource Type.
A constructed attribute materializes real attribute values from the state of an entry at a single point in time, whereas a constructed virtual attribute reconstructs values dynamically on request based on the current state of the entry.
↓Relations to This Component
↓Properties
↓dsconfig Usage
The following components have a direct aggregation relation to Constructed Attributes:
The properties supported by this managed object are as follows:
Basic Properties: | Advanced Properties: |
---|---|
↓ description | None |
↓ attribute-type | |
↓ value-pattern |
Description | A description for this Constructed Attribute |
Default Value | None |
Allowed Values | A string |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Specifies the attribute type for the attribute whose values are to be constructed. |
Default Value | None |
Allowed Values | The name or OID of an attribute type defined in the server schema. |
Multi-Valued | No |
Required | Yes |
Admin Action Required | None. Modification requires no further action |
Description | Specifies a pattern for constructing the attribute value using fixed text and attribute values from the entry. By default, any text provided in the value-pattern is copied verbatim into the target value with the exception of attribute names embedded in '{}'s. Attributes are substituted using their value, e.g. {uid} will select the uid attribute from the entry and use that value in place of {uid} in the value-pattern. At most one attribute may be multivalued. If one attribute is multivalued then the constructed attribute value will be multivalued with the same number of values minus any duplicates. For example a pattern of '{givenName} {sn}' would produce values ['Jim Smith', 'James Smith'] if givenName had values of ['Jim', 'James'] and sn had a value of 'Smith'. If the entry has no value or if there are multiple multivalued attributes, the attribute value construction will fail and no values will be constructed. To include a '{' in the constructed value use '{{' in the value-pattern. Likewise, '}}' will result in '}' in the value pattern. Furthermore, a regular expression with a substitution pattern can be used to further manipulate an individual attribute value. The java.util.regex.Pattern and java.util.regex.Matcher classes are used to perform the substitution. The regular expression with replacement value uses this syntax '{attr-name:/regex/replacement/flags}'. 'attr-name' is an attribute name such as 'cn'. 'regex' is a regular expression using the syntax described in the java.util.regex.Pattern javadoc. The optional flags value can also be used to change how this regular expression is interpreted. 'replacement' is a replacement value that is passed to the java.util.regex.Matcher#replaceFirst or java.util.regex.Matcher#replaceAll method to perform the replacement. The 'g' (global) flag controls whether replaceFirst or replaceAll is called. 'flags' is an optional set of single character flags that control how the regular expression is interpreted and how the replacement is performed. The flags are:
Pattern pattern = Pattern.compile(regex, flagsMask); To extract JSON fields within JSON attributes append '.' and then the JSON field to extract to the attribute name. For example, if 'ubidEmailJSON' is a JSON attribute and the 'value' field is to be extracted then 'ubidEmailJSON.value' could be specified for the attribute name resulting in '{ubidEmailJSON.value}' or '{ubidEmailJSON.value:/regex/replacement/flags}' if a regular expression is to be used. To apply modifiers to the values extracted append ':' and then the name of the modifier to apply. For example, if attribute 'mail' is to be included in a constructed JSON value then modifier 'jsonEscape' could be specified resulting in '{{ "userMail":"{mail:jsonEscape}" }}' or '{{ "userMail":"{mail:/regex/replacement/flags:jsonEscape}" }}' if a regular expression is to be used. Note that '{{' expands to '{' and '}}' to '}'. The modifiers are:
|
Default Value | None |
Allowed Values | The pattern to use to construct the attribute value. |
Multi-Valued | Yes |
Required | Yes |
Admin Action Required | None. Modification requires no further action |
To list the configured Constructed Attributes:
dsconfig list-constructed-attributes [--property {propertyName}] ...
To view the configuration for an existing Constructed Attribute:
dsconfig get-constructed-attribute-prop --attribute-name {name} [--tab-delimited] [--script-friendly] [--property {propertyName}] ...
To update the configuration for an existing Constructed Attribute:
dsconfig set-constructed-attribute-prop --attribute-name {name} (--set|--add|--remove) {propertyName}:{propertyValue} [(--set|--add|--remove) {propertyName}:{propertyValue}] ...
To create a new Constructed Attribute:
dsconfig create-constructed-attribute --attribute-name {name} --set attribute-type:{propertyValue} --set value-pattern:{propertyValue} [--set {propertyName}:{propertyValue}] ...
To delete an existing Constructed Attribute:
dsconfig delete-constructed-attribute --attribute-name {name}