Search in sources :

Example 1 with AccountSignupEvent

use of io.apiman.manager.api.beans.events.AccountSignupEvent in project apiman by apiman.

the class SsoEventService method newAccountCreated.

public void newAccountCreated(NewAccountCreatedDto newAccountCreatedDto) {
    ApimanEventHeaders headers = ApimanEventHeaders.builder().setId(key(newAccountCreatedDto.getUserId(), newAccountCreatedDto.getTime())).setSource(URI.create("http://replaceme.local/foo")).setSubject("new.account").build();
    AccountSignupEvent accountSignup = AccountSignupEvent.builder().setHeaders(headers).setUserId(newAccountCreatedDto.getUserId()).setUsername(newAccountCreatedDto.getUsername()).setEmailAddress(newAccountCreatedDto.getEmailAddress()).setFirstName(newAccountCreatedDto.getFirstName()).setSurname(newAccountCreatedDto.getSurname()).build();
    LOGGER.debug("Received an account creation event (externally): {0} => translated into: {1}", newAccountCreatedDto, accountSignup);
    eventService.fireEvent(accountSignup);
}
Also used : ApimanEventHeaders(io.apiman.manager.api.beans.events.ApimanEventHeaders) AccountSignupEvent(io.apiman.manager.api.beans.events.AccountSignupEvent)

Aggregations

AccountSignupEvent (io.apiman.manager.api.beans.events.AccountSignupEvent)1 ApimanEventHeaders (io.apiman.manager.api.beans.events.ApimanEventHeaders)1