Search in sources :

Example 1 with IsSendingAsyncMessage

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

the class ProjectAssignUserService method sendUserAddedToProjectEvent.

@IsSendingAsyncMessage(MessageID.USER_ADDED_TO_PROJECT)
private void sendUserAddedToProjectEvent(String projectId, User user) {
    DomainMessage request = new DomainMessage(MessageID.USER_ADDED_TO_PROJECT);
    UserMessage projectToUserData = new UserMessage();
    projectToUserData.setUserId(user.getName());
    projectToUserData.setProjectIds(Arrays.asList(projectId));
    request.set(MessageDataKeys.PROJECT_TO_USER_DATA, projectToUserData);
    eventBus.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 2 with IsSendingAsyncMessage

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

the class ProjectChangeAccessLevelService method sendProjectAccessLevelChangedEvent.

@IsSendingAsyncMessage(MessageID.PROJECT_ACCESS_LEVEL_CHANGED)
private void sendProjectAccessLevelChangedEvent(Project project, ProjectAccessLevel formerAccessLevel) {
    DomainMessage request = new DomainMessage(MessageID.PROJECT_ACCESS_LEVEL_CHANGED);
    ProjectMessage projectData = new ProjectMessage();
    projectData.setProjectId(project.id);
    projectData.setFormerAccessLevel(formerAccessLevel);
    projectData.setNewAccessLevel(project.getAccessLevel());
    request.set(MessageDataKeys.PROJECT_ACCESS_LEVEL_CHANGE_DATA, projectData);
    eventBus.sendAsynchron(request);
}
Also used : ProjectMessage(com.mercedesbenz.sechub.sharedkernel.messaging.ProjectMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 3 with IsSendingAsyncMessage

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

the class ProjectChangeOwnerService method sendOwnerChangedForProjectEvent.

@IsSendingAsyncMessage(MessageID.PROJECT_OWNER_CHANGED)
private void sendOwnerChangedForProjectEvent(Project project, User previousOwner, User newOwner) {
    DomainMessage request = new DomainMessage(MessageID.PROJECT_OWNER_CHANGED);
    ProjectMessage projectData = new ProjectMessage();
    projectData.setProjectId(project.id);
    projectData.setPreviousProjectOwnerEmailAddress(previousOwner.getEmailAdress());
    projectData.setProjectOwnerEmailAddress(newOwner.getEmailAdress());
    project.users.forEach(user -> {
        projectData.addUserEmailAddress(user.getEmailAdress());
    });
    request.set(MessageDataKeys.PROJECT_OWNER_CHANGE_DATA, projectData);
    eventBus.sendAsynchron(request);
}
Also used : ProjectMessage(com.mercedesbenz.sechub.sharedkernel.messaging.ProjectMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 4 with IsSendingAsyncMessage

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

the class UserEmailAddressUpdateService method informUserEmailAddressUpdated.

@IsSendingAsyncMessage(MessageID.USER_EMAIL_ADDRESS_CHANGED)
private void informUserEmailAddressUpdated(UserMessage message) {
    DomainMessage infoRequest = new DomainMessage(MessageID.USER_EMAIL_ADDRESS_CHANGED);
    infoRequest.set(MessageDataKeys.USER_EMAIL_ADDRESS_CHANGE_DATA, message);
    eventBusService.sendAsynchron(infoRequest);
}
Also used : DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 5 with IsSendingAsyncMessage

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

the class UserRoleCalculationService method sendUserRoleChangedEvent.

@IsSendingAsyncMessage(MessageID.USER_ROLES_CHANGED)
private void sendUserRoleChangedEvent(User user, Set<String> roles) {
    DomainMessage roleChangeRequest = new DomainMessage(MessageID.USER_ROLES_CHANGED);
    UserMessage rolesData = new UserMessage();
    rolesData.setUserId(user.getName());
    rolesData.setRoles(roles);
    roleChangeRequest.set(MessageDataKeys.USER_ROLES_DATA, rolesData);
    eventBus.sendAsynchron(roleChangeRequest);
}
Also used : UserMessage(com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage) 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