Class AirshipNotificationHandler
java.lang.Object
es.kukenan.smartfi.microservice.communication.service.provider.impl.airship.AirshipNotificationHandler
Service class that holds all the mail notification sending bussiness logic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AirshipPushClientAirship client.private AuditAirshipRepositoryAir shuip respository queries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<AuditAirship>generateAuditAirships(List<es.kukenan.smartfi.microservice.eventsender.events.event.Device> devices, es.kukenan.smartfi.microservice.eventsender.events.event.Notification notification) Insert new audit airship push notification.private SendPushRequestgenerateSendPushRequest(List<es.kukenan.smartfi.microservice.eventsender.events.event.Device> devices, es.kukenan.smartfi.microservice.eventsender.events.event.Notification notification) Generate send push request for airship push notifications.private com.urbanairship.api.client.ResponseCallbackprocessResponseMessages(List<AuditAirship> auditAirships) Process response messages from Airship.voidsend(es.kukenan.smartfi.microservice.eventsender.events.CotPushNotificationEvent cotPushNotificationEvent) Send push notification by airship.private List<AuditAirship>updateAuditAirshipState(List<AuditAirship> auditAirships, String state) Updated state for audit airship list.
-
Field Details
-
airshipPushClient
Airship client. -
auditAirshipRepository
Air shuip respository queries.
-
-
Constructor Details
-
AirshipNotificationHandler
public AirshipNotificationHandler()
-
-
Method Details
-
send
public void send(es.kukenan.smartfi.microservice.eventsender.events.CotPushNotificationEvent cotPushNotificationEvent) Send push notification by airship.- Parameters:
cotPushNotificationEvent- Event with COT Push notification data.
-
processResponseMessages
private com.urbanairship.api.client.ResponseCallback processResponseMessages(List<AuditAirship> auditAirships) Process response messages from Airship.- Parameters:
auditAirships- List of audit record for every device on COT PUsh notifications.- Returns:
- the
SendPushResponseobject.
-
generateAuditAirships
private List<AuditAirship> generateAuditAirships(List<es.kukenan.smartfi.microservice.eventsender.events.event.Device> devices, es.kukenan.smartfi.microservice.eventsender.events.event.Notification notification) Insert new audit airship push notification.- Parameters:
devices- List of devices to received a COT push notification.notification- Data with notification to send.- Returns:
- List of saved audir airship notifications.
-
generateSendPushRequest
private SendPushRequest generateSendPushRequest(List<es.kukenan.smartfi.microservice.eventsender.events.event.Device> devices, es.kukenan.smartfi.microservice.eventsender.events.event.Notification notification) Generate send push request for airship push notifications.- Parameters:
devices- List of devices to received a COT push notification.notification- ata with notification to send.- Returns:
- List of saved audir airship notifications.
-
updateAuditAirshipState
Updated state for audit airship list.- Parameters:
auditAirships- udit airshiop list for update.state- State for update.- Returns:
- List of audit airship with updated state.
-