Search in sources :

Example 6 with IsSendingAsyncMessage

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

the class InternalInitialDataService method informUserCreated.

@IsSendingAsyncMessage(MessageID.USER_CREATED)
private void informUserCreated(User user) {
    DomainMessage infoRequest = new DomainMessage(MessageID.USER_CREATED);
    UserMessage message = createInitialUserAuthData(user);
    infoRequest.set(MessageDataKeys.USER_CREATION_DATA, message);
    eventBusService.sendAsynchron(infoRequest);
}
Also used : UserMessage(com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 7 with IsSendingAsyncMessage

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

the class InternalInitialDataService method informUserAPITokenChanged.

@IsSendingAsyncMessage(MessageID.USER_API_TOKEN_CHANGED)
private void informUserAPITokenChanged(User user) {
    DomainMessage infoRequest = new DomainMessage(MessageID.USER_API_TOKEN_CHANGED);
    UserMessage message = createInitialUserAuthData(user);
    message.setHashedApiToken(user.getHashedApiToken());
    infoRequest.set(MessageDataKeys.USER_API_TOKEN_DATA, message);
    eventBusService.sendAsynchron(infoRequest);
}
Also used : UserMessage(com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 8 with IsSendingAsyncMessage

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

the class UserCreationService method informUserAboutSignupAccepted.

@IsSendingAsyncMessage(MessageID.USER_NEW_API_TOKEN_REQUESTED)
private void informUserAboutSignupAccepted(User user) {
    /* we just send info about new api token */
    DomainMessage infoRequest = new DomainMessage(MessageID.USER_NEW_API_TOKEN_REQUESTED);
    UserMessage userMessage = new UserMessage();
    userMessage.setEmailAdress(user.getEmailAdress());
    /*
         * Security: we do NOT use userid inside this link - if some body got
         * information about the link he/she is not able to use fetched api token
         * because not knowing which userid...
         */
    String linkWithOneTimeToken = environment.getServerBaseUrl() + AdministrationAPIConstants.API_FETCH_NEW_API_TOKEN_BY_ONE_WAY_TOKEN + "/" + user.getOneTimeToken();
    userMessage.setLinkWithOneTimeToken(linkWithOneTimeToken);
    userMessage.setSubject("SecHub user account created");
    infoRequest.set(MessageDataKeys.USER_ONE_TIME_TOKEN_INFO, userMessage);
    eventBusService.sendAsynchron(infoRequest);
}
Also used : UserMessage(com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 9 with IsSendingAsyncMessage

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

the class UserCreationService method informUserCreated.

@IsSendingAsyncMessage(MessageID.USER_CREATED)
private void informUserCreated(User user) {
    DomainMessage infoRequest = new DomainMessage(MessageID.USER_CREATED);
    UserMessage message = createInitialUserAuthData(user);
    infoRequest.set(MessageDataKeys.USER_CREATION_DATA, message);
    eventBusService.sendAsynchron(infoRequest);
}
Also used : UserMessage(com.mercedesbenz.sechub.sharedkernel.messaging.UserMessage) DomainMessage(com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage) IsSendingAsyncMessage(com.mercedesbenz.sechub.sharedkernel.messaging.IsSendingAsyncMessage)

Example 10 with IsSendingAsyncMessage

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

the class UserDeleteService method informUserDeleted.

@IsSendingAsyncMessage(MessageID.USER_DELETED)
private void informUserDeleted(UserMessage message) {
    DomainMessage infoRequest = new DomainMessage(MessageID.USER_DELETED);
    infoRequest.set(MessageDataKeys.USER_DELETE_DATA, message);
    eventBusService.sendAsynchron(infoRequest);
}
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