Package org.jboss.as.cli.operation.impl
Class DefaultOperationRequestBuilder
- java.lang.Object
-
- org.jboss.as.cli.operation.impl.DefaultOperationRequestBuilder
-
- All Implemented Interfaces:
OperationRequestBuilder
public class DefaultOperationRequestBuilder extends Object implements OperationRequestBuilder
- Author:
- Alexey Loubyansky
-
-
Constructor Summary
Constructors Constructor Description DefaultOperationRequestBuilder()DefaultOperationRequestBuilder(OperationRequestAddress prefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNode(String type, String name)The address is specified as a path to the target node.voidaddNodeName(String name)This method assumes there is a non-empty prefix which ends on a node type.voidaddNodeType(String type)This method is supposed to be invoked from applying the prefix with ends on a node type.voidaddProperty(String name, String value)Adds an argument.org.jboss.dmr.ModelNodebuildRequest()Makes sure that the operation name and the address have been set and returns a ModelNode representing the operation request.OperationRequestAddressgetAddress()org.jboss.dmr.ModelNodegetModelNode()voidsetOperationName(String name)Sets the name operation to be invoked.
-
-
-
Constructor Detail
-
DefaultOperationRequestBuilder
public DefaultOperationRequestBuilder()
-
DefaultOperationRequestBuilder
public DefaultOperationRequestBuilder(OperationRequestAddress prefix)
-
-
Method Detail
-
getAddress
public OperationRequestAddress getAddress()
-
buildRequest
public org.jboss.dmr.ModelNode buildRequest() throws OperationFormatExceptionMakes sure that the operation name and the address have been set and returns a ModelNode representing the operation request.- Specified by:
buildRequestin interfaceOperationRequestBuilder- Returns:
- an instance of ModelNode representing the operation request
- Throws:
OperationFormatException
-
setOperationName
public void setOperationName(String name)
Description copied from interface:OperationRequestBuilderSets the name operation to be invoked.- Specified by:
setOperationNamein interfaceOperationRequestBuilder- Parameters:
name- the name of the operation to invoke.
-
addNode
public void addNode(String type, String name)
Description copied from interface:OperationRequestBuilderThe address is specified as a path to the target node. Each element of the path is a node and is identified by its type and name.- Specified by:
addNodein interfaceOperationRequestBuilder- Parameters:
type- the type of the nodename- the name of the node
-
addNodeType
public void addNodeType(String type)
Description copied from interface:OperationRequestBuilderThis method is supposed to be invoked from applying the prefix with ends on a node type.- Specified by:
addNodeTypein interfaceOperationRequestBuilder- Parameters:
type- the type of the node.
-
addNodeName
public void addNodeName(String name)
Description copied from interface:OperationRequestBuilderThis method assumes there is a non-empty prefix which ends on a node type. Otherwise, this method will result in an exception.- Specified by:
addNodeNamein interfaceOperationRequestBuilder- Parameters:
name- the name of the node for the type specified by the prefix.
-
addProperty
public void addProperty(String name, String value)
Description copied from interface:OperationRequestBuilderAdds an argument.- Specified by:
addPropertyin interfaceOperationRequestBuilder- Parameters:
name- the name of the argumentvalue- the value of the argument
-
getModelNode
public org.jboss.dmr.ModelNode getModelNode()
-
-