Interface ResourceTransformationDescriptionBuilder
-
- All Superinterfaces:
TransformationDescriptionBuilder
public interface ResourceTransformationDescriptionBuilder extends TransformationDescriptionBuilder
Resource specific transformation description builder. This is a convenience API over the TransformersSubRegistration and can be used to add common policies when registering resource or operation transformers.- Author:
- Emanuel Muckenhuber, Kabir Khan
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.transform.description.TransformationDescriptionBuilder
TransformationDescriptionBuilder.Factory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceTransformationDescriptionBuilder
addChildBuilder(TransformationDescriptionBuilder builder)
Add an already createdTransformationDescriptionBuilder
as a child of this builder.ResourceTransformationDescriptionBuilder
addChildRedirection(PathElement current, PathElement legacy)
Add a child resource, where all operations will get redirected to the legacy address.ResourceTransformationDescriptionBuilder
addChildRedirection(PathElement current, PathElement legacy, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource, where all operations will get redirected to the legacy address.ResourceTransformationDescriptionBuilder
addChildRedirection(PathElement pathElement, PathAddressTransformer pathAddressTransformer)
Add a child resource, where all operation will get redirected to a different address defined by the path transformation.ResourceTransformationDescriptionBuilder
addChildRedirection(PathElement pathElement, PathAddressTransformer pathAddressTransformer, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource, where all operation will get redirected to a different address defined by the path transformation.ResourceTransformationDescriptionBuilder
addChildResource(PathElement pathElement)
Add a child resource to this builder.ResourceTransformationDescriptionBuilder
addChildResource(PathElement pathElement, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource to this builder.ResourceTransformationDescriptionBuilder
addChildResource(ResourceDefinition definition)
Add a child resource to this builder.ResourceTransformationDescriptionBuilder
addChildResource(ResourceDefinition definition, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource to this builder.OperationTransformationOverrideBuilder
addOperationTransformationOverride(String operationName)
Add an operation transformation entry for a given operation.ResourceTransformationDescriptionBuilder
addRawOperationTransformationOverride(String operationName, OperationTransformer operationTransformer)
Add an operation transformer.DiscardTransformationDescriptionBuilder
discardChildResource(PathElement pathElement)
Recursively discards all child resources and its operations.ResourceTransformationDescriptionBuilder
discardOperations(String... operationNames)
Don't forward and just discard the operation.AttributeTransformationDescriptionBuilder
getAttributeBuilder()
Get a builder to define custom attribute transformation rules.RejectTransformationDescriptionBuilder
rejectChildResource(PathElement pathElement)
Recursively rejects all child resources and its operationsResourceTransformationDescriptionBuilder
setCustomResourceTransformer(ResourceTransformer resourceTransformer)
Set an optional custom resource transformer.-
Methods inherited from interface org.jboss.as.controller.transform.description.TransformationDescriptionBuilder
build
-
-
-
-
Method Detail
-
getAttributeBuilder
AttributeTransformationDescriptionBuilder getAttributeBuilder()
Get a builder to define custom attribute transformation rules. These rules transform the resource and its operations.- Returns:
- the attribute transformation builder
-
addOperationTransformationOverride
OperationTransformationOverrideBuilder addOperationTransformationOverride(String operationName)
Add an operation transformation entry for a given operation. By default all operations inherit the attribute transformation rules from this transformation description. This behavior can be overridden for a given operation.- Parameters:
operationName
- the operation name- Returns:
- the operation transformation builder
-
addRawOperationTransformationOverride
ResourceTransformationDescriptionBuilder addRawOperationTransformationOverride(String operationName, OperationTransformer operationTransformer)
Add an operation transformer. Unlike the the addOperationTransformationOverride(String) this will use the OperationTransformer without adding any additional capabilities.- Parameters:
operationName
- the operation nameoperationTransformer
- the operation transformer- Returns:
- the builder for the current instance
-
setCustomResourceTransformer
ResourceTransformationDescriptionBuilder setCustomResourceTransformer(ResourceTransformer resourceTransformer)
Set an optional custom resource transformer. This transformer is going to be called after all attribute transformations set up bygetAttributeBuilder()
and needs to take care of adding the currently transformed resource properly. If not specified, the resource will be added according to other rules defined by this builder.- Parameters:
resourceTransformer
- the resource transformer- Returns:
- the builder for the current resource
-
addChildResource
ResourceTransformationDescriptionBuilder addChildResource(PathElement pathElement)
Add a child resource to this builder. This is going to register the child automatically at the TransformersSubRegistration when registering the transformation description created by this builder.- Parameters:
pathElement
- the path element- Returns:
- the builder for the child resource
-
addChildResource
ResourceTransformationDescriptionBuilder addChildResource(PathElement pathElement, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource to this builder. This is going to register the child automatically at the TransformersSubRegistration when registering the transformation description created by this builder.- Parameters:
pathElement
- the path elementdynamicDiscardPolicy
- a checker to decide whether the child should be added or not- Returns:
- the builder for the child resource
-
addChildResource
ResourceTransformationDescriptionBuilder addChildResource(ResourceDefinition definition)
Add a child resource to this builder. This is going to register the child automatically at the TransformersSubRegistration when registering the transformation description created by this builder.- Parameters:
definition
- the resource definition- Returns:
- the builder for the child resource
-
addChildResource
ResourceTransformationDescriptionBuilder addChildResource(ResourceDefinition definition, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource to this builder. This is going to register the child automatically at the TransformersSubRegistration when registering the transformation description created by this builder.- Parameters:
definition
- the resource definitiondynamicDiscardPolicy
- a checker to decide whether the child should be added or not- Returns:
- the builder for the child resource
-
discardChildResource
DiscardTransformationDescriptionBuilder discardChildResource(PathElement pathElement)
Recursively discards all child resources and its operations.- Parameters:
pathElement
- the path element- Returns:
- the builder for the child resource
-
rejectChildResource
RejectTransformationDescriptionBuilder rejectChildResource(PathElement pathElement)
Recursively rejects all child resources and its operations- Parameters:
pathElement
- the path element- Returns:
- the builder for the child resource
-
addChildRedirection
ResourceTransformationDescriptionBuilder addChildRedirection(PathElement current, PathElement legacy)
Add a child resource, where all operations will get redirected to the legacy address. You can either pass in- Fixed elements - e.g.
current:addr1=test
+legacy:addr2=toast
, in which caseaddr1=test
gets redirected toaddr2=toast
} - Wildcard elements - e.g.
current:addr1=*
+legacy:addr2=*
, in which caseaddr1=test
gets redirected toaddr2=test
,addr1=ping
gets redirected toaddr2=ping
, etc.
- Parameters:
current
- the current path elementlegacy
- the legacy path element.- Returns:
- the builder for the child resource
- Fixed elements - e.g.
-
addChildRedirection
ResourceTransformationDescriptionBuilder addChildRedirection(PathElement current, PathElement legacy, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource, where all operations will get redirected to the legacy address. You can either pass in- Fixed elements - e.g.
current:addr1=test
+legacy:addr2=toast
, in which caseaddr1=test
gets redirected toaddr2=toast
} - Wildcard elements - e.g.
current:addr1=*
+legacy:addr2=*
, in which caseaddr1=test
gets redirected toaddr2=test
,addr1=ping
gets redirected toaddr2=ping
, etc.
- Parameters:
current
- the current path elementlegacy
- the legacy path element.dynamicDiscardPolicy
- a checker to decide whether the child should be added or not- Returns:
- the builder for the child resource
- Fixed elements - e.g.
-
addChildRedirection
ResourceTransformationDescriptionBuilder addChildRedirection(PathElement pathElement, PathAddressTransformer pathAddressTransformer)
Add a child resource, where all operation will get redirected to a different address defined by the path transformation.- Parameters:
pathElement
- the path element of the childpathAddressTransformer
- the path transformation- Returns:
- the builder for the child resource
-
addChildRedirection
ResourceTransformationDescriptionBuilder addChildRedirection(PathElement pathElement, PathAddressTransformer pathAddressTransformer, DynamicDiscardPolicy dynamicDiscardPolicy)
Add a child resource, where all operation will get redirected to a different address defined by the path transformation.- Parameters:
pathElement
- the path element of the childpathAddressTransformer
- the path transformationdynamicDiscardPolicy
- a checker to decide whether the child should be added or not- Returns:
- the builder for the child resource
-
addChildBuilder
ResourceTransformationDescriptionBuilder addChildBuilder(TransformationDescriptionBuilder builder)
Add an already createdTransformationDescriptionBuilder
as a child of this builder.- Parameters:
builder
- the builder- Returns:
- the builder for this resource
-
discardOperations
ResourceTransformationDescriptionBuilder discardOperations(String... operationNames)
Don't forward and just discard the operation.- Parameters:
operationNames
- the operation names- Returns:
- the builder for this resource
-
-