Class NotificationCreatedEventService

java.lang.Object
es.kukenan.smartfi.microservice.communication.service.messaging.AbstractDomainEventService
es.kukenan.smartfi.microservice.communication.service.messaging.NotificationCreatedEventService

@Service public class NotificationCreatedEventService extends AbstractDomainEventService
This service owns the logic of the notifications created events processing.
  • Field Details

    • TEMPLATE_MESSAGE_FIELD

      public static final String TEMPLATE_MESSAGE_FIELD
      Template variable for message field.
      See Also:
    • usersRepository

      @Autowired private UsersRepository usersRepository
      users Repository.
  • Constructor Details

    • NotificationCreatedEventService

      public NotificationCreatedEventService()
  • Method Details

    • handleNotificationCreatedEvent

      public void handleNotificationCreatedEvent(es.kukenan.smartfi.microservice.contracts.events.created.NotificationCreatedEvent notificationCreatedEvent)
      Handles the given notifications request delivery NotificationCreatedEvent Event.
      Parameters:
      notificationCreatedEvent - object holding the notifications request details.
    • findUser

      private User findUser(String userId)
      Find user for template data.
      Parameters:
      userId - Skyline unique user identifier
      Returns:
      user found by skyline identifier.
    • getTemplateVariables

      private Map<String,Object> getTemplateVariables(es.kukenan.smartfi.microservice.contracts.events.created.NotificationCreatedEventBody body)
      Get event data to complete message template variables.
      Parameters:
      body - notification event body.
      Returns:
      Map with variables.