Class ResourceSchemaExtender
java.lang.Object
com.evolveum.midpoint.schema.processor.ResourceSchemaExtender
Builder-style class for extending resource schemas with additional definitions.
This class provides a way to augment resource schemas by adding custom definitions without modifying the original
resource or its parsed schema.
The extension process works by:
- Collecting all additions through method calls.
- Merging definitions if needed, utilizing the
BaseMergeOperation (e.g. when attribute definitions of the
same attribute, but with different mappings are added).
- Wrapping all definitions to the schema handling.
- Parsing the complete schema of the resource with additional schema handling.-
Constructor Summary
ConstructorsConstructorDescriptionResourceSchemaExtender(NativeResourceSchema nativeSchema, ResourceType resource) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeDefinition(ResourceObjectTypeIdentification objectTypeId, ResourceAttributeDefinitionType attributeDefinition) Adds an attribute definition to a specific resource object type.addCorrelationDefinition(ResourceObjectTypeIdentification objectTypeId, CorrelationDefinitionType correlationDefinition) Adds a correlation definition to a specific resource object type.extend()Parses and returns the complete resource schema including all added definitions.
-
Constructor Details
-
ResourceSchemaExtender
-
-
Method Details
-
addAttributeDefinition
public ResourceSchemaExtender addAttributeDefinition(ResourceObjectTypeIdentification objectTypeId, ResourceAttributeDefinitionType attributeDefinition) throws SchemaException, ConfigurationException Adds an attribute definition to a specific resource object type. If an attribute with the same reference has already been added, the new definition will be merged with the existing one usingBaseMergeOperation. Otherwise, the attribute definition will be added as a new attribute.- Parameters:
objectTypeId- The identification of the object type (kind and intent) to which the attribute belongs.attributeDefinition- The attribute definition to add or merge. Must contain a valid attribute reference.- Returns:
- This instance of the extender.
- Throws:
SchemaException- When a schema error occurs during merging of existing attribute definitions.ConfigurationException- When a config error occurs during merging of existing attribute definitions.
-
addCorrelationDefinition
public ResourceSchemaExtender addCorrelationDefinition(ResourceObjectTypeIdentification objectTypeId, CorrelationDefinitionType correlationDefinition) throws SchemaException, ConfigurationException Adds a correlation definition to a specific resource object type. If a correlation definition already exists for the object type, the new definition will be merged with the existing one usingBaseMergeOperation. Otherwise, the correlation definition will be set as the new correlation for the object type.- Parameters:
objectTypeId- The identification of the object type (kind and intent) to which the correlation belongs.correlationDefinition- The correlation definition to add or merge.- Returns:
- This instance of the extender.
- Throws:
SchemaException- When a schema error occurs during merging of existing correlation definitions.ConfigurationException- When a config error occurs during merging of existing correlation definitions.
-
extend
Parses and returns the complete resource schema including all added definitions. This method combines the original resource schema with all the definitions that have been added. NOTE: The parsing itself is delegated to theResourceSchemaParser.- Returns:
- The complete resource schema that includes all added definitions, appearing as if they were part of the original schema from the beginning.
- Throws:
SchemaException- When a schema error occurs during parsing of the resource schema.ConfigurationException- When a config error occurs during parsing of the resource schema.- See Also:
-