Package org.jboss.as.controller
Interface ExpressionResolver
-
- All Known Subinterfaces:
OperationContext
- All Known Implementing Classes:
ExpressionResolverImpl
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ExpressionResolver
ResolvesModelType.EXPRESSIONexpressions in aModelNode.- Author:
- Kabir Khan
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classExpressionResolver.ExpressionResolutionServerExceptionRuntime exception used to indicate a failure in someresolver extension executionnot due to problems with user input like the expression string being resolved or the configuration of resources backing the resolver extension.static classExpressionResolver.ExpressionResolutionUserExceptionRuntime exception used to indicate some user-driven problem that prevented expression resolution, for example: A flaw in a user provided expression string that results in aExpressionResolverExtensionnot being able to resolve the expression.
-
Field Summary
Fields Modifier and Type Field Description static PatternEXPRESSION_PATTERNAPatternthat can be used to identify strings that include expression syntaxstatic ExpressionResolverEXTENSION_REJECTINGAn expression resolver that throws anExpressionResolver.ExpressionResolutionServerExceptionif anyextension expressionsare found, otherwise providing the same behavior asSIMPLE.static ExpressionResolverREJECTINGAn expression resolver that throws anOperationFailedExceptionif any expressions are found.static ExpressionResolverSIMPLEAnExpressionResolverthat can only resolve from system properties and environment variables.static ExpressionResolverSIMPLE_LENIENTAn expression resolver that will not throw anOperationFailedExceptionwhen it encounters an unresolvable expression, instead simply returning that expression.static ExpressionResolverTEST_RESOLVERAnExpressionResolversuitable for test cases that can only resolve from system properties and environment variables.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.jboss.dmr.ModelNoderesolveExpressions(org.jboss.dmr.ModelNode node)Resolves any expressions in the passed in ModelNode.default org.jboss.dmr.ModelNoderesolveExpressions(org.jboss.dmr.ModelNode node, OperationContext context)Resolves any expressions in the passed in ModelNode.
-
-
-
Field Detail
-
EXPRESSION_PATTERN
static final Pattern EXPRESSION_PATTERN
APatternthat can be used to identify strings that include expression syntax
-
SIMPLE
static final ExpressionResolver SIMPLE
AnExpressionResolverthat can only resolve from system properties and environment variables. Should not be used for most product resolution use cases as it does not support resolution from resolver extensions.
-
TEST_RESOLVER
static final ExpressionResolver TEST_RESOLVER
AnExpressionResolversuitable for test cases that can only resolve from system properties and environment variables. Should not be used for production code as it does not support resolution from resolver extensions.
-
SIMPLE_LENIENT
static final ExpressionResolver SIMPLE_LENIENT
An expression resolver that will not throw anOperationFailedExceptionwhen it encounters an unresolvable expression, instead simply returning that expression. Should not be used for most product resolution use cases as it does not support resolution from resolver extensions.
-
REJECTING
static final ExpressionResolver REJECTING
An expression resolver that throws anOperationFailedExceptionif any expressions are found. Intended for use with APIs where anExpressionResolveris required but the caller requires that all expression have already been resolved.
-
EXTENSION_REJECTING
static final ExpressionResolver EXTENSION_REJECTING
An expression resolver that throws anExpressionResolver.ExpressionResolutionServerExceptionif anyextension expressionsare found, otherwise providing the same behavior asSIMPLE. Intended for use in cases whereExpressionResolverExtensions cannot be available but non-extension expression resolution is wanted.
-
-
Method Detail
-
resolveExpressions
org.jboss.dmr.ModelNode resolveExpressions(org.jboss.dmr.ModelNode node) throws OperationFailedExceptionResolves any expressions in the passed in ModelNode. Expressions may represent system properties, vaulted date, or a custom format to be handled by anExpressionResolverExtensionregistered using theResolverExtensionRegistry.- Parameters:
node- the ModelNode containing expressions.- Returns:
- a copy of the node with expressions resolved
- Throws:
ExpressionResolver.ExpressionResolutionUserException- ifexpressionis a form understood by the resolver but in some way is unacceptable. This should only be thrown due to flaws in the providedexpressionor the configuration of resources used by a resolver extension, which are 'user' problems. It should not be used for internal problems in the resolver or any extension. If a if a security manager exists and itscheckPermissionmethod doesn't allow access to a relevant system property or environment variable, anExpressionResolutionUserExceptionshould be thrown.OperationFailedException- if anExpressionResolverExtensionthrows one from itsExpressionResolverExtension.initialize(OperationContext)method.ExpressionResolver.ExpressionResolutionServerException- if some other internal expression resolution failure occurs.
-
resolveExpressions
default org.jboss.dmr.ModelNode resolveExpressions(org.jboss.dmr.ModelNode node, OperationContext context) throws OperationFailedExceptionResolves any expressions in the passed in ModelNode. Expressions may represent system properties, vaulted date, or a custom format to be handled by anExpressionResolverExtensionregistered using theResolverExtensionRegistry. For vaulted data the format is ${VAULT::vault_block::attribute_name::sharedKey}- Parameters:
node- the ModelNode containing expressions.context- the currentOperationContextto provide additional contextual information.- Returns:
- a copy of the node with expressions resolved
- Throws:
ExpressionResolver.ExpressionResolutionUserException- ifexpressionis a form understood by the resolver but in some way is unacceptable. This should only be thrown due to flaws in the providedexpressionor the configuration of resources used by the resolver extension, which are 'user' problems>. It should not be used for internal problems in the resolver extension. If a if a security manager exists and itscheckPermissionmethod doesn't allow access to a relevant system property or environment variable, anExpressionResolutionUserExceptionshould be thrownOperationFailedException- if anExpressionResolverExtensionthrows one from itsExpressionResolverExtension.initialize(OperationContext)method.ExpressionResolver.ExpressionResolutionServerException- if some other internal expression resolution failure occurs.
-
-