use of com.sequenceiq.freeipa.client.healthcheckmodel.CheckResult in project cloudbreak by hortonworks.
the class FreeIpaInstanceHealthDetailsService method createRpcMessageFromCheckResult.
private RPCMessage createRpcMessageFromCheckResult(RPCResponse<CheckResult> nodeHealth) {
List<CheckEntry> checkEntries = filterCheckEntries(nodeHealth);
List<PluginStatusEntry> pluginStatusEntries = filterPluginStatusEntries(nodeHealth);
CheckResult filteredCheckResult = new CheckResult();
filteredCheckResult.setChecks(checkEntries);
filteredCheckResult.setPluginStats(pluginStatusEntries);
if (nodeHealth.getResult() != null) {
filteredCheckResult.setStatus(nodeHealth.getResult().getStatus());
filteredCheckResult.setHost(nodeHealth.getResult().getHost());
}
RPCMessage rpcMessage = new RPCMessage();
rpcMessage.setName("node health check");
rpcMessage.setMessage(JsonUtil.writeValueAsStringSilent(filteredCheckResult));
if (nodeHealth.getFirstRpcMessage() != null) {
rpcMessage.setCode(nodeHealth.getFirstRpcMessage().getCode());
}
return rpcMessage;
}
Aggregations