return Collections.emptyList();
}
private void validateRequest(CommandContext ctx, ModelNode request) throws CommandFormatException {
final ModelControllerClient client = ctx.getModelControllerClient();
if(client == null) {
throw new CommandFormatException("No connection to the controller.");
}
final Set<String> keys = request.keys();
if(!keys.contains(Util.OPERATION)) {
throw new CommandFormatException("Request is missing the operation name.");
}
final String operationName = request.get(Util.OPERATION).asString();
if(!keys.contains(Util.ADDRESS)) {
throw new CommandFormatException("Request is missing the address part.");
}
final ModelNode address = request.get(Util.ADDRESS);
if(keys.size() == 2) { // no props
return;
}
final ModelNode opDescrReq = new ModelNode();
opDescrReq.get(Util.ADDRESS).set(address);
opDescrReq.get(Util.OPERATION).set(Util.READ_OPERATION_DESCRIPTION);
opDescrReq.get(Util.NAME).set(operationName);
final ModelNode outcome;
try {
outcome = client.execute(opDescrReq);
} catch(Exception e) {
throw new CommandFormatException("Failed to perform " + Util.READ_OPERATION_DESCRIPTION + " to validate the request: " + e.getLocalizedMessage());
}
if (!Util.isSuccess(outcome)) {
throw new CommandFormatException("Failed to get the list of the operation properties: \"" + Util.getFailureDescription(outcome) + '\"');