Interface BaseAttributeTransformationDescriptionBuilder<T extends BaseAttributeTransformationDescriptionBuilder<?>>

All Known Subinterfaces:
AttributeTransformationDescriptionBuilder, OperationTransformationOverrideBuilder

public interface BaseAttributeTransformationDescriptionBuilder<T extends BaseAttributeTransformationDescriptionBuilder<?>>
Builder for the attribute transformer for a resource/operation. The transformer created by this interface executes the following phases in the following order:
    • DISCARD - All attributes with a DiscardAttributeChecker registered are checked to see if the attribute should be discarded, and gets discarded if that is the outcome. If an attribute is discarded it does not get passed to the next phases.
      REJECT - All attributes with a RejectAttributeCheckers registered (and which have not been discarded) are checked to see if the attribute should be rejected
      CONVERT - All attributes with a AttributeConverter registered are checked to see if the attribute should be converted. If the attribute does not exist in the original operation/resource the AttributeConverter may register a new attribute
      RENAME - All attributes with a rename registered are renamed
  • All attributes are processed in each phase before moving onto the next one. See the individual methods for information about how to add rules for each phase. The ResourceTransformer which may be registered for a resource in ResourceTransformationDescriptionBuilder.setCustomResourceTransformer(org.jboss.as.controller.transform.ResourceTransformer) is executed after all the conversions done by this builder.
    Author:
    Emanuel Muckenhuber, Kabir Khan
    See Also:
    • Method Details

      • addRejectCheck

        T addRejectCheck(RejectAttributeChecker rejectChecker, String... rejectedAttributes)
        Adds a RejectAttributeChecker. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.

        Rejection is done in the REJECT phase.

        Parameters:
        rejectChecker - the checker
        rejectedAttributes - the attributes to check
        Returns:
        this builder
      • addRejectCheck

        T addRejectCheck(RejectAttributeChecker rejectChecker, AttributeDefinition... rejectedAttributes)
        Adds a RejectAttributeChecker. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.

        Rejection is done in the REJECT phase.

        Parameters:
        rejectChecker - the checker
        rejectedAttributes - the attributes to check
        Returns:
        this builder
      • addRejectChecks

        T addRejectChecks(List<RejectAttributeChecker> rejectCheckers, String... rejectedAttributes)
        Adds a list of RejectAttributeCheckers. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.

        Rejection is done in the REJECT phase.

        Parameters:
        rejectCheckers - the checkers
        rejectedAttributes - the attributes to check
        Returns:
        this builder
      • addRejectChecks

        T addRejectChecks(List<RejectAttributeChecker> rejectCheckers, AttributeDefinition... rejectedAttributes)
        Adds a list of RejectAttributeCheckers. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.

        Rejection is done in the REJECT phase.

        Parameters:
        rejectCheckers - the checkers
        rejectedAttributes - the attributes to check
        Returns:
        this builder
      • setDiscard

        T setDiscard(DiscardAttributeChecker discardChecker, String... discardedAttributes)
        Sets the DiscardChecker to be used to check if an attribute should be discarded. Only one discard checker can be used for an attribute.

        Discard is done in the DISCARD phase.

        Parameters:
        discardChecker - the checkers
        discardedAttributes - the attributes to check
        Returns:
        this builder
      • setDiscard

        T setDiscard(DiscardAttributeChecker discardChecker, AttributeDefinition... discardedAttributes)
        Sets the DiscardChecker to be used to check if an attribute should be discarded. Only one discard checker can be used for an attribute.

        Discard is done in the DISCARD phase.

        Parameters:
        discardChecker - the checkers
        discardedAttributes - the attributes to check
        Returns:
        this builder
      • setDiscard

        T setDiscard(DiscardAttributeChecker discardChecker, Collection<AttributeDefinition> discardedAttributes)
        Sets the DiscardChecker to be used to check if an attribute should be discarded. Only one discard checker can be used for an attribute.

        Discard is done in the DISCARD phase.

        Parameters:
        discardChecker - the checkers
        discardedAttributes - the attributes to check
        Returns:
        this builder
      • addRename

        T addRename(String attributeName, String newName)
        Rename an attribute. An attribute can only be renamed once.

        Renaming is done in the RENAME phase.

        Parameters:
        attributeName - the attribute's original name
        newName - the new name for the attribute
        Returns:
        this builder
      • addRename

        T addRename(AttributeDefinition attributeName, String newName)
        Rename an attribute. An attribute can only be renamed once.

        Renaming is done in the RENAME phase.

        Parameters:
        attributeName - the attribute's original name
        newName - the new name for the attribute
        Returns:
        this builder
      • addRenames

        T addRenames(Map<String,String> renames)
        Rename attributes. Each attribute can only be renamed once.

        Renaming is done in the RENAME phase.

        Parameters:
        renames - a Map where the keys are the original attribute names, and the values are the new attribute names
        Returns:
        this builder
      • setValueConverter

        T setValueConverter(AttributeConverter attributeConverter, String... convertedAttributes)
        Use to convert an attribute's value. If it is a new attribute that did not exist in the original resource/operation, it is added. Only one AttributeConverter can be added per attribute.

        Conversion/Adding is done in the CONVERT phase.

        Parameters:
        attributeConverter - the attribute converter used to convert the value of each attribute
        convertedAttributes - the attributes the attribute converter should be used on
        Returns:
        this builder
      • setValueConverter

        T setValueConverter(AttributeConverter attributeConverter, AttributeDefinition... convertedAttributes)
        Use to convert an attribute's value. If it is a new attribute that did not exist in the original resource/operation, it is added. Only one AttributeConverter can be added per attribute.

        Conversion/Adding is done in the CONVERT phase.

        Parameters:
        attributeConverter - the attribute converter used to convert the value of each attribute
        convertedAttributes - the attributes the attribute converter should be used on
        Returns:
        this builder
      • end

        Finish with this attribute builder and return control to the parent resource transformation builder
        Returns:
        the parent builder