Class ResourceSchemaExtender

java.lang.Object
com.evolveum.midpoint.schema.processor.ResourceSchemaExtender

public final class ResourceSchemaExtender extends Object
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.
See Also:
  • Constructor Details

  • Method Details

    • addAttributeDefinition

      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 using BaseMergeOperation. 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 using BaseMergeOperation. 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 the ResourceSchemaParser.
      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: