private void addNodeAndTaskInformation(ClusterStatusInformation info, PrismObject<NodeType> node, OperationResult parentResult) {
OperationResult result = parentResult.createSubresult(ExecutionManager.class.getName() + ".addNodeAndTaskInformation");
result.addParam("node", node);
if (isCurrentNode(node)) {
LOGGER.trace("Getting node and task info from the current node ({})", node.asObjectable().getNodeIdentifier());
List<ClusterStatusInformation.TaskInfo> taskInfoList = new ArrayList<>();
Set<Task> tasks = localNodeManager.getLocallyRunningTasks(result);
for (Task task : tasks) {
taskInfoList.add(new ClusterStatusInformation.TaskInfo(task.getOid()));
}
node.asObjectable().setExecutionStatus(localNodeManager.getLocalNodeExecutionStatus());
node.asObjectable().setErrorStatus(taskManager.getLocalNodeErrorStatus());
info.addNodeAndTaskInfo(node.asObjectable(), taskInfoList);
} else {
LOGGER.debug("Getting running task info from remote node ({}, {})", node.asObjectable().getNodeIdentifier(), node.asObjectable().getHostname());
remoteNodesManager.addNodeStatusFromRemoteNode(info, node, result);
}
result.recordSuccessIfUnknown();
}