use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class TriggerSchedulerStatusRefreshService method sendUpdateSchedulerStatusEvent.
@IsSendingAsyncMessage(MessageID.REQUEST_SCHEDULER_STATUS_UPDATE)
private void sendUpdateSchedulerStatusEvent() {
DomainMessage request = DomainMessageFactory.createEmptyRequest(MessageID.REQUEST_SCHEDULER_STATUS_UPDATE);
eventBusService.sendAsynchron(request);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class AnonymousSignupCreateService method informAboutSignupRequest.
@IsSendingAsyncMessage(MessageID.USER_SIGNUP_REQUESTED)
private void informAboutSignupRequest(Signup signup) {
DomainMessage infoRequest = new DomainMessage(MessageID.USER_SIGNUP_REQUESTED);
UserMessage userMessage = new UserMessage();
userMessage.setEmailAdress(signup.getEmailAdress());
userMessage.setUserId(signup.getUserId());
infoRequest.set(MessageDataKeys.USER_SIGNUP_DATA, userMessage);
eventBusService.sendAsynchron(infoRequest);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class AnonymousUserGetAPITokenByOneTimeTokenService method sendUserAPITokenChanged.
@IsSendingAsyncMessage(MessageID.USER_API_TOKEN_CHANGED)
private void sendUserAPITokenChanged(User user) {
DomainMessage request = new DomainMessage(MessageID.USER_API_TOKEN_CHANGED);
UserMessage message = new UserMessage();
message.setEmailAdress(user.getEmailAdress());
message.setUserId(user.getName());
message.setHashedApiToken(user.getHashedApiToken());
request.set(MessageDataKeys.USER_API_TOKEN_DATA, message);
eventBusService.sendAsynchron(request);
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class ScheduleJobLauncherServiceTest method executeJob__sends_domain_message_about_JOB_STARTED.
@Test
public void executeJob__sends_domain_message_about_JOB_STARTED() throws Exception {
/* prepare */
UUID jobUUID = UUID.randomUUID();
ScheduleSecHubJob secHubJob = mock(ScheduleSecHubJob.class);
when(secHubJob.getJsonConfiguration()).thenReturn("jsonConfig");
when(secHubJob.getUUID()).thenReturn(jobUUID);
when(jobRepository.findNextJobToExecute()).thenReturn(Optional.of(secHubJob));
/* execute */
serviceToTest.executeJob(secHubJob);
/* test */
ArgumentCaptor<DomainMessage> message = ArgumentCaptor.forClass(DomainMessage.class);
verify(eventBus).sendAsynchron(message.capture());
assertEquals(MessageID.JOB_STARTED, message.getValue().getMessageId());
}
use of com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage in project sechub by mercedes-benz.
the class AdministrationConfigService method sendEvent.
@IsSendingAsyncMessage(MessageID.AUTO_CLEANUP_CONFIGURATION_CHANGED)
private void sendEvent(long calculateCleanupTimeInDays) {
AdministrationConfigMessage adminConfigMessage = new AdministrationConfigMessage();
adminConfigMessage.setAutoCleanupInDays(calculateCleanupTimeInDays);
DomainMessage domainMessage = DomainMessageFactory.createEmptyRequest(MessageID.AUTO_CLEANUP_CONFIGURATION_CHANGED);
domainMessage.set(MessageDataKeys.AUTO_CLEANUP_CONFIG_CHANGE_DATA, adminConfigMessage);
domainMessageService.sendAsynchron(domainMessage);
}
Aggregations