use of com.mercedesbenz.sechub.sharedkernel.messaging.SchedulerMessage in project sechub by mercedes-benz.
the class SchedulerStatusService method buildStatus.
@IsSendingAsyncMessage(MessageID.SCHEDULER_STATUS_UPDATE)
public void buildStatus() {
DomainMessage message = DomainMessageFactory.createEmptyRequest(MessageID.SCHEDULER_STATUS_UPDATE);
SchedulerMessage sm = new SchedulerMessage();
long amountOfJobsAll = jobRepository.count();
long amountOfRunningJobs = jobRepository.countRunningJobs();
long amountOfWaitingJobs = jobRepository.countWaitingJobs();
boolean processingEnabled = configService.isJobProcessingEnabled();
sm.setAmountOfJobsAll(amountOfJobsAll);
sm.setAmountOfRunningJobs(amountOfRunningJobs);
sm.setAmountOfWaitingJobs(amountOfWaitingJobs);
sm.setJobProcessingEnabled(processingEnabled);
message.set(MessageDataKeys.SCHEDULER_STATUS_DATA, sm);
eventBus.sendAsynchron(message);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.SchedulerMessage in project sechub by mercedes-benz.
the class SchedulerAdministrationMessageHandler method handleSchedulerStatusChange.
@IsReceivingAsyncMessage(MessageID.SCHEDULER_STATUS_UPDATE)
private void handleSchedulerStatusChange(DomainMessage request) {
SchedulerMessage status = request.get(MessageDataKeys.SCHEDULER_STATUS_DATA);
updateSchedulerJobProcessingEnabled(status.isJobProcessingEnabled());
updateSchedulerJobInformation(status);
}
Aggregations