Class NotificationStatusChangeService

java.lang.Object
es.kukenan.smartfi.microservice.communication.service.NotificationStatusChangeService

@Component public class NotificationStatusChangeService extends Object
In this component we will add the logic required to store the notifications and notification status updates.
  • Field Details

    • repository

      @Autowired private NotificationsRepository repository
      Notifications repository which holds DB operations.
    • customObjectMapper

      @Autowired private es.kukenan.smartfi.common.utils.CustomObjectMapper customObjectMapper
      Object mapper for JSON transformations.
  • Constructor Details

    • NotificationStatusChangeService

      public NotificationStatusChangeService()
  • Method Details

    • updateNotification

      public void updateNotification(NotificationUpdate notificationUpdate)
      Update the information persisted about a notification from a received notification update.
      Parameters:
      notificationUpdate - the notification update event data.
    • updateExternalNotification

      private void updateExternalNotification(NotificationUpdate notificationUpdate)
      Update an external notification (without id) database entity from a notification update event data.
      Parameters:
      notificationUpdate - the notification update event data.
    • updateInternalNotification

      private void updateInternalNotification(NotificationUpdate notificationUpdate)
      Update an external notification (with id) database entity from a notification update event data.
      Parameters:
      notificationUpdate - the notification update event data.
    • applyChangesToNotificationEntity

      private void applyChangesToNotificationEntity(NotificationUpdate notificationUpdate, Notification notificationEntity)
      Updates the given notification entity by applying the changes in the given update.
      Parameters:
      notificationUpdate - the notification update.
      notificationEntity - the notification entity to update.