use of org.jboss.as.cli.operation.OperationRequestAddress.Node in project wildfly-core by wildfly.
the class CLIAccessControl method setAddress.
private static void setAddress(ModelNode request, String[] parent, OperationRequestAddress address) {
final ModelNode addressNode = request.get(Util.ADDRESS);
addressNode.setEmptyList();
if (parent != null) {
int i = 0;
while (i < parent.length) {
addressNode.add(parent[i++], parent[i++]);
}
}
if (!address.isEmpty()) {
final Iterator<Node> iterator = address.iterator();
while (iterator.hasNext()) {
final OperationRequestAddress.Node node = iterator.next();
if (node.getName() != null) {
addressNode.add(node.getType(), node.getName());
} else if (iterator.hasNext()) {
throw new IllegalArgumentException("The node name is not specified for type '" + node.getType() + "'");
}
}
}
}
Aggregations