use of io.datarouter.tasktracker.service.LongRunningTaskService.LongRunningTaskSummaryDto in project datarouter by hotpads.
the class JobHandler method list.
@Handler
Mav list(OptionalString category, OptionalString keyword, OptionalBoolean enabled, OptionalBoolean disabled) {
Optional<String> message = params.optional("jobTriggerResponseMessage");
Mav mav = new Mav(files.jsp.admin.datarouter.job.triggersJsp);
if (message.isPresent()) {
mav.put("message", message.get());
}
Optional<String> jobCategoryName = category.getOptional();
boolean hideEnabled = enabled.orElse(false);
boolean hideDisabled = disabled.orElse(false);
mav.put("serverName", serverName.get());
mav.put("categoryRows", getJobCategoryDtos(jobCategoryName));
LongRunningTaskSummaryDto longRunningTaskSummary = longRunningTaskService.getSummary();
AtomicInteger rowId = new AtomicInteger();
List<TriggerJspDto> triggerRows = jobPackageFilter.streamMatches(jobCategoryName.orElse(""), keyword.orElse(""), hideEnabled, hideDisabled).map(jobClass -> jobToTriggerJspDto(rowId.incrementAndGet(), jobClass, longRunningTaskSummary)).collect(Collectors.toList());
mav.put("triggerRows", triggerRows);
mav.put("legend", LongRunningTasksHandler.legend().renderFormatted());
return mav;
}
Aggregations