Class NotificationStatusChangeService
java.lang.Object
es.kukenan.smartfi.microservice.communication.service.NotificationStatusChangeService
In this component we will add the logic required to store the notifications and notification status updates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate es.kukenan.smartfi.common.utils.CustomObjectMapperObject mapper for JSON transformations.private NotificationsRepositoryNotifications repository which holds DB operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapplyChangesToNotificationEntity(NotificationUpdate notificationUpdate, Notification notificationEntity) Updates the given notification entity by applying the changes in the given update.private voidupdateExternalNotification(NotificationUpdate notificationUpdate) Update an external notification (without id) database entity from a notification update event data.private voidupdateInternalNotification(NotificationUpdate notificationUpdate) Update an external notification (with id) database entity from a notification update event data.voidupdateNotification(NotificationUpdate notificationUpdate) Update the information persisted about a notification from a received notification update.
-
Field Details
-
repository
Notifications repository which holds DB operations. -
customObjectMapper
@Autowired private es.kukenan.smartfi.common.utils.CustomObjectMapper customObjectMapperObject mapper for JSON transformations.
-
-
Constructor Details
-
NotificationStatusChangeService
public NotificationStatusChangeService()
-
-
Method Details
-
updateNotification
Update the information persisted about a notification from a received notification update.- Parameters:
notificationUpdate- the notification update event data.
-
updateExternalNotification
Update an external notification (without id) database entity from a notification update event data.- Parameters:
notificationUpdate- the notification update event data.
-
updateInternalNotification
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.
-