private ModelNode executeForResponse(Operation op) { try { return client.execute(op); } catch (IOException e) { throw new RuntimeException(e); } }
ModelNode result = getManagementClient().getControllerClient().execute(op, null); if (Operations.isSuccessfulOutcome(result)) { final String hostName = Operations.readResult(result).asString();
private ModelNode executeForResult(final ModelNode operation) throws Exception { final ModelNode result = client.execute(operation); checkSuccessful(result, operation); return result.get(RESULT); }
public ModelNode executeForResult(Operation op) { try { ModelNode result = getDomainClient().execute(op); if (result.hasDefined("outcome") && "success".equals(result.get("outcome").asString())) { return result.get("result"); } else if (result.hasDefined("failure-description")) { throw new RuntimeException(result.get("failure-description").toString()); } else if (result.hasDefined("domain-failure-description")) { throw new RuntimeException(result.get("domain-failure-description").toString()); } else if (result.hasDefined("host-failure-descriptions")) { throw new RuntimeException(result.get("host-failure-descriptions").toString()); } else { throw new RuntimeException("Operation outcome is " + result.get("outcome").asString()); } } catch (IOException e) { throw new RuntimeException(e); } }
public ModelNode executeForResult(Operation op) { try { ModelNode result = getDomainClient().execute(op); if (result.hasDefined("outcome") && "success".equals(result.get("outcome").asString())) { return result.get("result"); } else if (result.hasDefined("failure-description")) { throw new RuntimeException(result.get("failure-description").toString()); } else if (result.hasDefined("domain-failure-description")) { throw new RuntimeException(result.get("domain-failure-description").toString()); } else if (result.hasDefined("host-failure-descriptions")) { throw new RuntimeException(result.get("host-failure-descriptions").toString()); } else { throw new RuntimeException("Operation outcome is " + result.get("outcome").asString()); } } catch (IOException e) { throw new RuntimeException(e); } }
.addStep(Operations.createReadAttributeOperation(hostAddress, "running-mode")) .addStep(Operations.createReadAttributeOperation(hostAddress, "host-state")); ModelNode response = domainClient.execute(builder.build()); if (Operations.isSuccessfulOutcome(response)) { response = Operations.readResult(response);