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 interfaceMultistepUtil.OperationHandlerResolverResolves anOperationStepHandlerto use given a set of inputs.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidrecordOperationSteps(OperationContext context, Map<T,org.jboss.dmr.ModelNode> operations, Map<T,org.jboss.dmr.ModelNode> responses)Adds a step to the givenOperationContextfor each operation included in the given map, either using for each step a response node provided in theresponsesmap, or if theresponsesmap is empty, creating them and storing them in theresponsesmap.static <T> voidrecordOperationSteps(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 theOperationStepHandlerto 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 givenOperationContextfor each operation included in the given map, either using for each step a response node provided in theresponsesmap, or if theresponsesmap is empty, creating them and storing them in theresponsesmap. 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
operationsmap must provide an iterator over its entry set that provides the entries in the order in which the operations should execute. ALinkedHashMapis the typical choice.- Type Parameters:
T- the type of the keys in the maps- Parameters:
context- theOperationContext. Cannot benulloperations- 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 theoperationsparam. Cannot benullbut 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 theOperationStepHandlerto 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 benulloperations- 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 theoperationsparam. Cannot benullbut 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 theOperationStepHandlerto use for the operationadjustAddresses-trueif the address of each operation should be adjusted to become a child of the context'scurrent addressrejectPrivateOperations-trueif anOperationFailedExceptionshould be thrown if theOperationEntryfor any of theoperationsisOperationEntry.EntryType.PRIVATE- Throws:
OperationFailedException- if there is a problem registering a step for any of the operations
-
-