private static Map<String, ServerGroupDeploymentPlanResult> buildServerGroupResults(Map<UUID, DeploymentActionResult> deploymentActionResults) { Map<String, ServerGroupDeploymentPlanResult> serverGroupResults = new HashMap<String, ServerGroupDeploymentPlanResult>(); for (Map.Entry<UUID, DeploymentActionResult> entry : deploymentActionResults.entrySet()) { UUID actionId = entry.getKey(); DeploymentActionResult actionResult = entry.getValue(); Map<String, ServerGroupDeploymentActionResult> actionResultsByServerGroup = actionResult.getResultsByServerGroup(); for (ServerGroupDeploymentActionResult serverGroupActionResult : actionResultsByServerGroup.values()) { String serverGroupName = serverGroupActionResult.getServerGroupName(); ServerGroupDeploymentPlanResultImpl sgdpr = (ServerGroupDeploymentPlanResultImpl) serverGroupResults.get(serverGroupName); if (sgdpr == null) { sgdpr = new ServerGroupDeploymentPlanResultImpl(serverGroupName); serverGroupResults.put(serverGroupName, sgdpr); } for (Map.Entry<String, ServerUpdateResult> serverEntry : serverGroupActionResult.getResultByServer().entrySet()) { String serverName = serverEntry.getKey(); ServerUpdateResult sud = serverEntry.getValue(); ServerDeploymentPlanResultImpl sdpr = (ServerDeploymentPlanResultImpl) sgdpr.getServerResult(serverName); if (sdpr == null) { sdpr = new ServerDeploymentPlanResultImpl(serverName); sgdpr.storeServerResult(serverName, sdpr); } sdpr.storeServerUpdateResult(actionId, sud); } } } return serverGroupResults; }
private static Map<String, ServerGroupDeploymentPlanResult> buildServerGroupResults(Map<UUID, DeploymentActionResult> deploymentActionResults) { Map<String, ServerGroupDeploymentPlanResult> serverGroupResults = new HashMap<String, ServerGroupDeploymentPlanResult>(); for (Map.Entry<UUID, DeploymentActionResult> entry : deploymentActionResults.entrySet()) { UUID actionId = entry.getKey(); DeploymentActionResult actionResult = entry.getValue(); Map<String, ServerGroupDeploymentActionResult> actionResultsByServerGroup = actionResult.getResultsByServerGroup(); for (ServerGroupDeploymentActionResult serverGroupActionResult : actionResultsByServerGroup.values()) { String serverGroupName = serverGroupActionResult.getServerGroupName(); ServerGroupDeploymentPlanResultImpl sgdpr = (ServerGroupDeploymentPlanResultImpl) serverGroupResults.get(serverGroupName); if (sgdpr == null) { sgdpr = new ServerGroupDeploymentPlanResultImpl(serverGroupName); serverGroupResults.put(serverGroupName, sgdpr); } for (Map.Entry<String, ServerUpdateResult> serverEntry : serverGroupActionResult.getResultByServer().entrySet()) { String serverName = serverEntry.getKey(); ServerUpdateResult sud = serverEntry.getValue(); ServerDeploymentPlanResultImpl sdpr = (ServerDeploymentPlanResultImpl) sgdpr.getServerResult(serverName); if (sdpr == null) { sdpr = new ServerDeploymentPlanResultImpl(serverName); sgdpr.storeServerResult(serverName, sdpr); } sdpr.storeServerUpdateResult(actionId, sud); } } } return serverGroupResults; }