Search in sources :

Example 1 with LongRunningTaskSummaryDto

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;
}
Also used : Scanner(io.datarouter.scanner.Scanner) LongRunningTaskTrackerFactory(io.datarouter.tasktracker.service.LongRunningTaskTrackerFactory) Date(java.util.Date) JobCategoryTracker(io.datarouter.job.scheduler.JobCategoryTracker) DurationTool(io.datarouter.util.time.DurationTool) LoggerFactory(org.slf4j.LoggerFactory) OptionalString(io.datarouter.web.handler.types.optional.OptionalString) ServerName(io.datarouter.storage.config.properties.ServerName) TreeSet(java.util.TreeSet) ChangelogRecorder(io.datarouter.instrumentation.changelog.ChangelogRecorder) Inject(javax.inject.Inject) LongRunningTaskService(io.datarouter.tasktracker.service.LongRunningTaskService) StringMav(io.datarouter.web.handler.mav.imp.StringMav) LongRunningTasksHandler(io.datarouter.tasktracker.web.LongRunningTasksHandler) MessageMav(io.datarouter.web.handler.mav.imp.MessageMav) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) JobScheduler(io.datarouter.job.scheduler.JobScheduler) Duration(java.time.Duration) JobStopperService(io.datarouter.job.service.JobStopperService) InContextRedirectMav(io.datarouter.web.handler.mav.imp.InContextRedirectMav) LongRunningTaskSummaryDto(io.datarouter.tasktracker.service.LongRunningTaskService.LongRunningTaskSummaryDto) Logger(org.slf4j.Logger) DatarouterChangelogDtoBuilder(io.datarouter.instrumentation.changelog.ChangelogRecorder.DatarouterChangelogDtoBuilder) BaseJob(io.datarouter.job.BaseJob) DatarouterJobFiles(io.datarouter.job.config.DatarouterJobFiles) Mav(io.datarouter.web.handler.mav.Mav) Set(java.util.Set) StringTool(io.datarouter.util.string.StringTool) Collectors(java.util.stream.Collectors) OptionalBoolean(io.datarouter.web.handler.types.optional.OptionalBoolean) List(java.util.List) DatarouterJobPaths(io.datarouter.job.config.DatarouterJobPaths) JobPackage(io.datarouter.job.scheduler.JobPackage) BaseHandler(io.datarouter.web.handler.BaseHandler) Optional(java.util.Optional) Require(io.datarouter.util.Require) LongRunningTask(io.datarouter.tasktracker.storage.LongRunningTask) LongRunningTaskHeartBeatStatus(io.datarouter.tasktracker.storage.LongRunningTaskHeartBeatStatus) StringMav(io.datarouter.web.handler.mav.imp.StringMav) MessageMav(io.datarouter.web.handler.mav.imp.MessageMav) InContextRedirectMav(io.datarouter.web.handler.mav.imp.InContextRedirectMav) Mav(io.datarouter.web.handler.mav.Mav) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) OptionalString(io.datarouter.web.handler.types.optional.OptionalString) LongRunningTaskSummaryDto(io.datarouter.tasktracker.service.LongRunningTaskService.LongRunningTaskSummaryDto) LongRunningTasksHandler(io.datarouter.tasktracker.web.LongRunningTasksHandler) BaseHandler(io.datarouter.web.handler.BaseHandler)

Aggregations

ChangelogRecorder (io.datarouter.instrumentation.changelog.ChangelogRecorder)1 DatarouterChangelogDtoBuilder (io.datarouter.instrumentation.changelog.ChangelogRecorder.DatarouterChangelogDtoBuilder)1 BaseJob (io.datarouter.job.BaseJob)1 DatarouterJobFiles (io.datarouter.job.config.DatarouterJobFiles)1 DatarouterJobPaths (io.datarouter.job.config.DatarouterJobPaths)1 JobCategoryTracker (io.datarouter.job.scheduler.JobCategoryTracker)1 JobPackage (io.datarouter.job.scheduler.JobPackage)1 JobScheduler (io.datarouter.job.scheduler.JobScheduler)1 JobStopperService (io.datarouter.job.service.JobStopperService)1 Scanner (io.datarouter.scanner.Scanner)1 ServerName (io.datarouter.storage.config.properties.ServerName)1 LongRunningTaskService (io.datarouter.tasktracker.service.LongRunningTaskService)1 LongRunningTaskSummaryDto (io.datarouter.tasktracker.service.LongRunningTaskService.LongRunningTaskSummaryDto)1 LongRunningTaskTrackerFactory (io.datarouter.tasktracker.service.LongRunningTaskTrackerFactory)1 LongRunningTask (io.datarouter.tasktracker.storage.LongRunningTask)1 LongRunningTaskHeartBeatStatus (io.datarouter.tasktracker.storage.LongRunningTaskHeartBeatStatus)1 LongRunningTasksHandler (io.datarouter.tasktracker.web.LongRunningTasksHandler)1 Require (io.datarouter.util.Require)1 StringTool (io.datarouter.util.string.StringTool)1 DurationTool (io.datarouter.util.time.DurationTool)1