java.lang.Object
es.kukenan.smartfi.microservice.communication.service.provider.impl.airship.AirshipNotificationHandler

@Component public class AirshipNotificationHandler extends Object
Service class that holds all the mail notification sending bussiness logic.
  • Field Details

    • airshipPushClient

      @Autowired private AirshipPushClient airshipPushClient
      Airship client.
    • auditAirshipRepository

      @Autowired private AuditAirshipRepository 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 SendPushResponse object.
    • 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

      private List<AuditAirship> updateAuditAirshipState(List<AuditAirship> auditAirships, String state)
      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.