private void scheduleInstalls(SsmInstallPackagesEvent event, User user) {

    log.debug("Scheduling package installations.");
    Date earliest = event.getEarliest();
    Set<String> data = event.getPackages();
    Long channelId = event.getChannelId();

    List<EssentialServerDto> servers =
        SystemManager.systemsSubscribedToChannelInSet(channelId, user, SetLabels.SYSTEM_LIST);

    // Convert the package list to domain objects
    List<PackageListItem> packageListItems = new ArrayList<PackageListItem>(data.size());
    for (String key : data) {
      packageListItems.add(PackageListItem.parse(key));
    }

    // Convert to list of maps
    List<Map<String, Long>> packageListData = PackageListItem.toKeyMaps(packageListItems);

    // Create one action for all servers to which the packages are installed
    List<Long> serverIds = new LinkedList<Long>();
    for (EssentialServerDto dto : servers) {
      serverIds.add(dto.getId());
    }

    log.debug("Scheduling actions.");
    ActionManager.schedulePackageInstall(user, serverIds, packageListData, earliest);
    log.debug("Done scheduling package installations.");
  }
  protected List<Action> doSchedule(
      SsmPackageEvent event, User user, List<Long> sids, Date earliest, ActionChain actionChain) {
    SsmInstallPackagesEvent sipe = (SsmInstallPackagesEvent) event;

    Set<String> data = sipe.getPackages();
    // Convert the package list to domain objects
    List<PackageListItem> pkgListItems = new ArrayList<PackageListItem>(data.size());
    for (String key : data) {
      pkgListItems.add(PackageListItem.parse(key));
    }

    // Convert to list of maps
    List<Map<String, Long>> packageListData = PackageListItem.toKeyMaps(pkgListItems);

    return ActionChainManager.schedulePackageInstalls(
        user, sids, packageListData, earliest, actionChain);
  }