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("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