result.setExitCode(response.getStatus());
result.setExitCodeInfo(response.getStatusInfo().toString());
}
try {
JsonObject json = response.readEntity(JsonObject.class);
JsonString message = json.getJsonString(JSON_OBJECT_MESSAGE);
if (message != null) {
result.setResult(message.toString());
}
JsonString exitCode = json.getJsonString("exit_code");
if (exitCode != null) {
if ("SUCCESS".equals(exitCode.getString())) {
result.setExitCodeOk();
}
}
} catch (Exception ex) {
result.setResult("Could not read result from server.");