Class MultistepUtil
- java.lang.Object
-
- org.jboss.as.controller.operations.MultistepUtil
-
public final class MultistepUtil extends Object
Utility code related to multistep operations.- Author:
- Brian Stansberry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MultistepUtil.OperationHandlerResolver
Resolves anOperationStepHandler
to use given a set of inputs.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> void
recordOperationSteps(OperationContext context, Map<T,org.jboss.dmr.ModelNode> operations, Map<T,org.jboss.dmr.ModelNode> responses)
Adds a step to the givenOperationContext
for each operation included in the given map, either using for each step a response node provided in theresponses
map, or if theresponses
map is empty, creating them and storing them in theresponses
map.static <T> void
recordOperationSteps(OperationContext context, Map<T,org.jboss.dmr.ModelNode> operations, Map<T,org.jboss.dmr.ModelNode> responses, MultistepUtil.OperationHandlerResolver handlerResolver, boolean adjustAddresses, boolean rejectPrivateOperations)
This is a specialized version of the other variant of this method that allows a pluggable strategy for resolving theOperationStepHandler
to use for the added steps.
-
-
-
Method Detail
-
recordOperationSteps
public static <T> void recordOperationSteps(OperationContext context, Map<T,org.jboss.dmr.ModelNode> operations, Map<T,org.jboss.dmr.ModelNode> responses) throws OperationFailedException
Adds a step to the givenOperationContext
for each operation included in the given map, either using for each step a response node provided in theresponses
map, or if theresponses
map is empty, creating them and storing them in theresponses
map. The response objects are not tied into the overall response to the operation associated withcontext
. It is the responsibility of the caller to do that.NOTE: The given
operations
map must provide an iterator over its entry set that provides the entries in the order in which the operations should execute. ALinkedHashMap
is the typical choice.- Type Parameters:
T
- the type of the keys in the maps- Parameters:
context
- theOperationContext
. Cannot benull
operations
- the operations, each value of which must be a proper OBJECT type model node with a structure describing an operation.responses
- a map of the response nodes, the keys for which match the keys in theoperations
param. Cannot benull
but may be empty in which case this method will create the response nodes and store them in this map.- Throws:
OperationFailedException
- if there is a problem registering a step for any of the operations
-
recordOperationSteps
public static <T> void recordOperationSteps(OperationContext context, Map<T,org.jboss.dmr.ModelNode> operations, Map<T,org.jboss.dmr.ModelNode> responses, MultistepUtil.OperationHandlerResolver handlerResolver, boolean adjustAddresses, boolean rejectPrivateOperations) throws OperationFailedException
This is a specialized version of the other variant of this method that allows a pluggable strategy for resolving theOperationStepHandler
to use for the added steps. It is not expected to be needed by users outside the WildFly Core kernel.- Type Parameters:
T
- the type of the keys in the maps- Parameters:
context
- theOperationContext
. Cannot benull
operations
- the operations, each value of which must be a proper OBJECT type model node with a structure describing an operation.responses
- a map of the response nodes, the keys for which match the keys in theoperations
param. Cannot benull
but may be empty in which case this method will create the response nodes and store them in this map.handlerResolver
- an object that can provide theOperationStepHandler
to use for the operationadjustAddresses
-true
if the address of each operation should be adjusted to become a child of the context'scurrent address
rejectPrivateOperations
-true
if anOperationFailedException
should be thrown if theOperationEntry
for any of theoperations
isOperationEntry.EntryType.PRIVATE
- Throws:
OperationFailedException
- if there is a problem registering a step for any of the operations
-
-