public static UpgradeUpdateEvent formFullEvent(HostRoleCommandDAO hostRoleCommandDAO, RequestDAO requestDAO, UpgradeEntity upgradeEntity,
                                                 UpdateEventType type) {
    UpgradeUpdateEvent upgradeUpdateEvent = new UpgradeUpdateEvent(UpdateEventType.CREATE);
    Map<Long, HostRoleCommandStatusSummaryDTO> summary = hostRoleCommandDAO.findAggregateCounts(
        upgradeEntity.getRequestId());
    CalculatedStatus calc = CalculatedStatus.statusFromStageSummary(summary, summary.keySet());
    double progressPercent;
    if (calc.getStatus() == HostRoleStatus.ABORTED && upgradeEntity.isSuspended()) {
      double percent = UpgradeResourceProvider.calculateAbortedProgress(summary);
      progressPercent = percent*100;
    } else {
      progressPercent = calc.getPercent();
    }

    RequestEntity rentity = requestDAO.findByPK(upgradeEntity.getRequestId());

    upgradeUpdateEvent.setUpgradeId(upgradeEntity.getId());
    upgradeUpdateEvent.setAssociatedVersion(upgradeEntity.getRepositoryVersion().getVersion());
    upgradeUpdateEvent.setClusterId(upgradeEntity.getClusterId());
    upgradeUpdateEvent.setDirection(upgradeEntity.getDirection());
    upgradeUpdateEvent.setDowngradeAllowed(upgradeEntity.isDowngradeAllowed());
    upgradeUpdateEvent.setRequestId(upgradeEntity.getRequestId());
    upgradeUpdateEvent.setRequestStatus(calc.getStatus());
    upgradeUpdateEvent.setSkipFailures(upgradeEntity.isComponentFailureAutoSkipped());
    upgradeUpdateEvent.setSkipServiceCheckFailures(upgradeEntity.isServiceCheckFailureAutoSkipped());
    upgradeUpdateEvent.setUpgradeType(upgradeEntity.getUpgradeType());
    upgradeUpdateEvent.setStartTime(rentity.getStartTime());
    upgradeUpdateEvent.setEndTime(rentity.getEndTime());
    upgradeUpdateEvent.setSuspended(upgradeEntity.isSuspended());
    upgradeUpdateEvent.setProgressPercent(progressPercent);
    upgradeUpdateEvent.setRevertAllowed(upgradeEntity.isRevertAllowed());

    return upgradeUpdateEvent;
  }
Contains information about cluster upgrade state update. This update will be sent to all subscribed recipients.
Used for messaging to UI.
ambari-server/src/main/java/org/apache/ambari/server/events/UpgradeUpdateEvent.java