Class DefaultCheckersAndConverter
- java.lang.Object
-
- org.jboss.as.controller.transform.description.DiscardAttributeChecker.DefaultDiscardAttributeChecker
-
- org.jboss.as.controller.transform.description.DefaultCheckersAndConverter
-
- All Implemented Interfaces:
AttributeConverter
,DiscardAttributeChecker
,RejectAttributeChecker
public abstract class DefaultCheckersAndConverter extends DiscardAttributeChecker.DefaultDiscardAttributeChecker implements RejectAttributeChecker, AttributeConverter
Utility class combining the functionality ofDiscardAttributeChecker.DefaultDiscardAttributeChecker
,RejectAttributeChecker.DefaultRejectAttributeChecker
andAttributeConverter.DefaultAttributeConverter
. Only the parts that are registered inBaseAttributeTransformationDescriptionBuilder
will be used.- Author:
- Kabir Khan
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.transform.description.AttributeConverter
AttributeConverter.DefaultAttributeConverter, AttributeConverter.DefaultValueAttributeConverter, AttributeConverter.Factory
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.transform.description.DiscardAttributeChecker
DiscardAttributeChecker.DefaultDiscardAttributeChecker, DiscardAttributeChecker.DiscardAttributeValueChecker
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.transform.description.RejectAttributeChecker
RejectAttributeChecker.DefaultRejectAttributeChecker, RejectAttributeChecker.ListRejectAttributeChecker, RejectAttributeChecker.ObjectFieldsRejectAttributeChecker, RejectAttributeChecker.SimpleAcceptAttributeChecker, RejectAttributeChecker.SimpleRejectAttributeChecker
-
-
Field Summary
-
Fields inherited from class org.jboss.as.controller.transform.description.DiscardAttributeChecker.DefaultDiscardAttributeChecker
discardExpressions, discardUndefined
-
Fields inherited from interface org.jboss.as.controller.transform.description.AttributeConverter
DEFAULT_VALUE, NAME_FROM_ADDRESS
-
Fields inherited from interface org.jboss.as.controller.transform.description.DiscardAttributeChecker
ALWAYS, DEFAULT_VALUE, UNDEFINED
-
Fields inherited from interface org.jboss.as.controller.transform.description.RejectAttributeChecker
ALL, DEFINED, SIMPLE_EXPRESSIONS, UNDEFINED
-
-
Constructor Summary
Constructors Modifier Constructor Description DefaultCheckersAndConverter()
Constructor.protected
DefaultCheckersAndConverter(boolean discardExpressions, boolean discardUndefined)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
checkForExpression(org.jboss.dmr.ModelNode node)
protected abstract void
convertAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Gets called by the default implementations ofconvertOperationParameter(PathAddress, String, ModelNode, ModelNode, TransformationContext)
andconvertResourceAttribute(PathAddress, String, ModelNode, TransformationContext)
.void
convertOperationParameter(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, org.jboss.dmr.ModelNode operation, TransformationContext context)
Converts an operation parametervoid
convertResourceAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Converts a resource attributeString
getRejectionLogMessageId()
Returns the log message id used by this checker.protected abstract boolean
rejectAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Gets called by the default implementations of#rejectOperationParameter(String, ModelNode, ModelNode, TransformationContext)
and#rejectResourceAttribute(String, ModelNode, TransformationContext)
.boolean
rejectOperationParameter(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, org.jboss.dmr.ModelNode operation, TransformationContext context)
Determines whether the given operation parameter value is not understandable by the target process and needs to be rejected.boolean
rejectResourceAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Gets whether the given resource attribute value is not understandable by the target process and needs to be rejected.-
Methods inherited from class org.jboss.as.controller.transform.description.DiscardAttributeChecker.DefaultDiscardAttributeChecker
isDiscardExpressions, isDiscardUndefined, isOperationParameterDiscardable, isResourceAttributeDiscardable, isValueDiscardable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.controller.transform.description.RejectAttributeChecker
getRejectionLogMessage
-
-
-
-
Constructor Detail
-
DefaultCheckersAndConverter
protected DefaultCheckersAndConverter(boolean discardExpressions, boolean discardUndefined)
Constructor- Parameters:
discardExpressions
-true
if the attribute should be discarded if expressions are useddiscardUndefined
-true
if the attribute should be discarded if expressions are used
-
DefaultCheckersAndConverter
public DefaultCheckersAndConverter()
Constructor. Sets it up withdiscardExpressions==false
anddiscardUndefined==true
-
-
Method Detail
-
convertOperationParameter
public void convertOperationParameter(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, org.jboss.dmr.ModelNode operation, TransformationContext context)
Converts an operation parameter- Specified by:
convertOperationParameter
in interfaceAttributeConverter
- Parameters:
address
- the address of the operationattributeName
- the name of the operation parameterattributeValue
- the value of the operation parameter to be convertedoperation
- the operation executed. This is unmodifiable.context
- the context of the transformation
-
convertResourceAttribute
public void convertResourceAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Converts a resource attribute- Specified by:
convertResourceAttribute
in interfaceAttributeConverter
- Parameters:
address
- the address of the operationattributeName
- the name of the attributeattributeValue
- the value of the attribute to be convertedcontext
- the context of the transformation
-
rejectOperationParameter
public boolean rejectOperationParameter(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, org.jboss.dmr.ModelNode operation, TransformationContext context)
Determines whether the given operation parameter value is not understandable by the target process and needs to be rejected.- Specified by:
rejectOperationParameter
in interfaceRejectAttributeChecker
- Parameters:
address
- the address of the operationattributeName
- the name of the attributeattributeValue
- the value of the attributeoperation
- the operation executed. This is unmodifiable.context
- the context of the transformation- Returns:
true
if the parameter value is not understandable by the target process and so needs to be rejected,false
otherwise.
-
rejectResourceAttribute
public boolean rejectResourceAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Gets whether the given resource attribute value is not understandable by the target process and needs to be rejected.- Specified by:
rejectResourceAttribute
in interfaceRejectAttributeChecker
- Parameters:
address
- the address of the resourceattributeName
- the name of the attributeattributeValue
- the value of the attributecontext
- the context of the transformation- Returns:
true
if the attribute value is not understandable by the target process and so needs to be rejected,false
otherwise.
-
getRejectionLogMessageId
public String getRejectionLogMessageId()
Returns the log message id used by this checker. This is used to group it so that all attributes failing a type of rejction end up in the same error message. This default implementation uses the formatted log message with an empty attribute map as the id.- Specified by:
getRejectionLogMessageId
in interfaceRejectAttributeChecker
- Returns:
- the log message id
-
checkForExpression
protected boolean checkForExpression(org.jboss.dmr.ModelNode node)
-
rejectAttribute
protected abstract boolean rejectAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Gets called by the default implementations of#rejectOperationParameter(String, ModelNode, ModelNode, TransformationContext)
and#rejectResourceAttribute(String, ModelNode, TransformationContext)
.- Parameters:
address
- the address of the operationattributeName
- the name of the attributeattributeValue
- the value of the attributecontext
- the context of the transformation- Returns:
true
if the attribute or parameter value is not understandable by the target process and so needs to be rejected,false
otherwise.
-
convertAttribute
protected abstract void convertAttribute(PathAddress address, String attributeName, org.jboss.dmr.ModelNode attributeValue, TransformationContext context)
Gets called by the default implementations ofconvertOperationParameter(PathAddress, String, ModelNode, ModelNode, TransformationContext)
andconvertResourceAttribute(PathAddress, String, ModelNode, TransformationContext)
.- Parameters:
address
- the address of the operation or resourceattributeName
- the name of the attributeattributeValue
- the value of the attributecontext
- the context of the transformation
-
-