Search in sources :

Example 16 with IsSendingAsyncMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage 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);
}
Also used : UserMessage(com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 17 with IsSendingAsyncMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage 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);
}
Also used : AdministrationConfigMessage(com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 18 with IsSendingAsyncMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage in project sechub by mercedes-benz.

the class SchedulerRestartJobService method sendJobRestartCanceled.

@IsSendingAsyncMessage(MessageID.JOB_RESTART_CANCELED)
private void sendJobRestartCanceled(JobDataContext context) {
    DomainMessage request = DomainMessageFactory.createEmptyRequest(MessageID.JOB_RESTART_CANCELED);
    JobMessage message = new JobMessage();
    message.setJobUUID(context.sechubJobUUID);
    message.setProjectId(context.projectId);
    message.setOwner(context.owner);
    message.setOwnerEmailAddress(context.ownerEmailAddress);
    message.setInfo(context.info);
    request.set(MessageDataKeys.JOB_RESTART_DATA, message);
    request.set(MessageDataKeys.ENVIRONMENT_BASE_URL, sechubEnvironment.getServerBaseUrl());
    eventBus.sendAsynchron(request);
}
Also used : JobMessage(com.mercedesbenz.sechub.sharedkernel.messaging.JobMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 19 with IsSendingAsyncMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage in project sechub by mercedes-benz.

the class SchedulerRestartJobService method sendJobRestartTriggered.

@IsSendingAsyncMessage(MessageID.JOB_RESTART_TRIGGERED)
private void sendJobRestartTriggered(ScheduleSecHubJob secHubJob, String ownerEmailAddress) {
    DomainMessage request = DomainMessageFactory.createEmptyRequest(MessageID.JOB_RESTART_TRIGGERED);
    JobMessage message = new JobMessage();
    message.setJobUUID(secHubJob.getUUID());
    message.setProjectId(secHubJob.getProjectId());
    message.setOwner(secHubJob.getOwner());
    message.setOwnerEmailAddress(ownerEmailAddress);
    request.set(MessageDataKeys.JOB_RESTART_DATA, message);
    request.set(MessageDataKeys.ENVIRONMENT_BASE_URL, sechubEnvironment.getServerBaseUrl());
    eventBus.sendAsynchron(request);
}
Also used : JobMessage(com.mercedesbenz.sechub.sharedkernel.messaging.JobMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 20 with IsSendingAsyncMessage

use of com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage in project sechub by mercedes-benz.

the class ProductResultService method sendJobResultsPurged.

@IsSendingAsyncMessage(MessageID.JOB_RESULTS_PURGED)
private void sendJobResultsPurged(UUID jobUUID) {
    DomainMessage request = DomainMessageFactory.createEmptyRequest(MessageID.JOB_RESULTS_PURGED);
    request.set(MessageDataKeys.SECHUB_UUID, jobUUID);
    request.set(MessageDataKeys.ENVIRONMENT_BASE_URL, sechubEnvironment.getServerBaseUrl());
    eventBus.sendAsynchron(request);
}
Also used : DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Aggregations

IsSendingAsyncMessage (com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)32 DomainMessage (com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage)31 UserMessage (com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage)10 JobMessage (com.mercedesbenz.sechub.sharedkernel.messaging.JobMessage)4 ProjectMessage (com.mercedesbenz.sechub.sharedkernel.messaging.ProjectMessage)4 AuthUser (com.mercedesbenz.sechub.domain.authorization.AuthUser)1 AdministrationConfigMessage (com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage)1 MappingMessage (com.mercedesbenz.sechub.sharedkernel.messaging.MappingMessage)1 SchedulerMessage (com.mercedesbenz.sechub.sharedkernel.messaging.SchedulerMessage)1 UseCaseAdminAcceptsSignup (com.mercedesbenz.sechub.sharedkernel.usecases.admin.signup.UseCaseAdminAcceptsSignup)1