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 aDiscardAttributeChecker
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 aRejectAttributeChecker
s registered (and which have not been discarded) are checked to see if the attribute should be rejectedCONVERT
- All attributes with aAttributeConverter
registered are checked to see if the attribute should be converted. If the attribute does not exist in the original operation/resource theAttributeConverter
may register a new attributeRENAME
- All attributes with a rename registered are renamedResourceTransformer
which may be registered for a resource inResourceTransformationDescriptionBuilder.setCustomResourceTransformer(org.jboss.as.controller.transform.ResourceTransformer)
is executed after all the conversions done by this builder.- Author:
- Emanuel Muckenhuber, Kabir Khan
- See Also:
ResourceTransformationDescriptionBuilder.getAttributeBuilder()
,ResourceTransformationDescriptionBuilder.setCustomResourceTransformer(org.jboss.as.controller.transform.ResourceTransformer)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
addRejectCheck(RejectAttributeChecker rejectChecker, String... rejectedAttributes)
Adds a RejectAttributeChecker.T
addRejectCheck(RejectAttributeChecker rejectChecker, AttributeDefinition... rejectedAttributes)
Adds a RejectAttributeChecker.T
addRejectChecks(List<RejectAttributeChecker> rejectCheckers, String... rejectedAttributes)
Adds a list of RejectAttributeCheckers.T
addRejectChecks(List<RejectAttributeChecker> rejectCheckers, AttributeDefinition... rejectedAttributes)
Adds a list of RejectAttributeCheckers.T
addRename(String attributeName, String newName)
Rename an attribute.T
addRename(AttributeDefinition attributeName, String newName)
Rename an attribute.T
addRenames(Map<String,String> renames)
Rename attributes.ResourceTransformationDescriptionBuilder
end()
Finish with this attribute builder and return control to the parent resource transformation builderT
setDiscard(DiscardAttributeChecker discardChecker, String... discardedAttributes)
Sets the DiscardChecker to be used to check if an attribute should be discarded.T
setDiscard(DiscardAttributeChecker discardChecker, Collection<AttributeDefinition> discardedAttributes)
Sets the DiscardChecker to be used to check if an attribute should be discarded.T
setDiscard(DiscardAttributeChecker discardChecker, AttributeDefinition... discardedAttributes)
Sets the DiscardChecker to be used to check if an attribute should be discarded.T
setValueConverter(AttributeConverter attributeConverter, String... convertedAttributes)
Use to convert an attribute's value.T
setValueConverter(AttributeConverter attributeConverter, AttributeDefinition... convertedAttributes)
Use to convert an attribute's value.
-
-
-
Method Detail
-
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 checkerrejectedAttributes
- 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 checkerrejectedAttributes
- 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 checkersrejectedAttributes
- 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 checkersrejectedAttributes
- 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 checkersdiscardedAttributes
- 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 checkersdiscardedAttributes
- 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 checkersdiscardedAttributes
- 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 namenewName
- 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 namenewName
- 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 attributeconvertedAttributes
- 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 attributeconvertedAttributes
- the attributes the attribute converter should be used on- Returns:
- this builder
-
end
ResourceTransformationDescriptionBuilder end()
Finish with this attribute builder and return control to the parent resource transformation builder- Returns:
- the parent builder
-
-