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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations