while (iterator.hasNext()) {
OperationRequestAddress.Node node = iterator.next();
if (node.getName() != null) {
addressNode.add(node.getType(), node.getName());
} else if (iterator.hasNext()) {
throw new OperationFormatException(
"The node name is not specified for type '"
+ node.getType() + "'");
}
}
}
if(operationName == null || operationName.isEmpty()) {
throw new OperationFormatException("The operation name is missing or the format of the operation request is wrong.");
}
request.get(Util.OPERATION).set(operationName);
for(String propName : props.keySet()) {
final String value = props.get(propName);
if(propName == null || propName.trim().isEmpty())
throw new OperationFormatException("The argument name is not specified: '" + propName + "'");
if(value == null || value.trim().isEmpty())
throw new OperationFormatException("The argument value is not specified for " + propName + ": '" + value + "'");
ModelNode toSet = null;
try {
toSet = ModelNode.fromString(value);
} catch (Exception e) {
// just use the string
toSet = new ModelNode().set(value);
}
request.get(propName).set(toSet);
}
if(this.lastHeaderName != null) {
throw new OperationFormatException("Header '" + this.lastHeaderName + "' is not complete.");
}
if(headers != null) {
final ModelNode headersNode = request.get(Util.OPERATION_HEADERS);
for(ParsedOperationRequestHeader header : headers.values()) {
header.addTo(ctx, headersNode);