class SchedulerStartHandler {

    String buildZombieInformation(List<ScheduleSecHubJob> jobsRunningButStartedBefore) {
        if (jobsRunningButStartedBefore == null || jobsRunningButStartedBefore.isEmpty()) {
            return "OK: No zombie jobs found";
        }
        StringBuilder sb = new StringBuilder();
        sb.append("---------------------------------------\n");
        sb.append("ATTENTION: Potential zombie jobs found:\n");
        sb.append("---------------------------------------\n");

        for (ScheduleSecHubJob potentialZombieJob : jobsRunningButStartedBefore) {
            sb.append("- job:").append(potentialZombieJob.getUUID());
            sb.append(", started:").append(potentialZombieJob.getStarted());
            sb.append(", execution-state:").append(potentialZombieJob.getExecutionState());
            sb.append("\n");
        }
        sb.append(
                "\nPlease check if they have been already started by another before started (and still running) scheduler instance. If identified as zombie job you have to restart the job!");
        return sb.toString();
    }

}