Class MailjetEventsService
java.lang.Object
es.kukenan.smartfi.microservice.communication.service.provider.impl.mailjet.MailjetEventsService
This class groups the logic to handle MailJet real time event notification API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionInternal queue controller.private NotificationStatusChangeServiceThe service that handles notification updates.private es.kukenan.smartfi.common.utils.CustomObjectMapperJSON to object mapper.private es.kukenan.smartfi.common.context.RequestContextManagerRequest context manager. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringnotificationComments(AbstractEvent mailJetEvent) Create a custom comment value with specific concrete event information.private NotificationStatusnotificationStatus(AbstractEvent mailJetEvent) /** Get the notification status mapped from the event type.voidreceiveFromInternalQueue(AbstractEvent mailJetEvent) This method is invoked when a MailJet event is received.voidreceiveFromMailjet(AbstractEvent... mailJetEvents) This method in invoked when a MailJet events are received.private StringsafeObjectAsString(Object object)
-
Field Details
-
eventsQueueController
Internal queue controller. -
objectMapper
@Autowired private es.kukenan.smartfi.common.utils.CustomObjectMapper objectMapperJSON to object mapper. -
notificationStatusChangeService
The service that handles notification updates. -
requestContextManager
@Autowired private es.kukenan.smartfi.common.context.RequestContextManager requestContextManagerRequest context manager.
-
-
Constructor Details
-
MailjetEventsService
public MailjetEventsService()
-
-
Method Details
-
receiveFromMailjet
This method in invoked when a MailJet events are received. They will be published into an internal queue for load-balancing purposes (receiveFromInternalQueue(AbstractEvent)).- Parameters:
mailJetEvents- the MailJet real time API Events.
-
receiveFromInternalQueue
This method is invoked when a MailJet event is received. MailJet events must be converted toNotificationUpdateand then delegated to theNotificationStatusChangeService.- Parameters:
mailJetEvent- the MailJet real time API Event.
-
notificationStatus
/** Get the notification status mapped from the event type.- Parameters:
mailJetEvent- the MailJet event.- Returns:
- the notification status that corresponds to the given event type.
-
notificationComments
Create a custom comment value with specific concrete event information.- Parameters:
mailJetEvent- the MailJet event.- Returns:
- a string with specific concrete event information.
-
safeObjectAsString
-