Class ParsingMockApnsServerListenerAdapter

  • All Implemented Interfaces:
    MockApnsServerListener

    public abstract class ParsingMockApnsServerListenerAdapter
    extends Object
    implements MockApnsServerListener

    A parsing APNs server listener is an abstract base class that parses HTTP/2 headers and payload byte buffers from a mock APNs server into ApnsPushNotification instances for easier handling.

    Note that the mock server's decision to accept or reject a push notification is controlled by its PushNotificationHandler. As a result, notifications accepted by a mock server might be rejected by a real APNs server or vice versa. Push notifications parsed by this class may have missing, incomplete, or nonsense data regardless of whether they were accepted or rejected, and callers should use appropriate caution.

    Since:
    0.12
    See Also:
    MockApnsServerBuilder.setListener(MockApnsServerListener)
    • Constructor Detail

      • ParsingMockApnsServerListenerAdapter

        public ParsingMockApnsServerListenerAdapter()
    • Method Detail

      • handlePushNotificationAccepted

        public abstract void handlePushNotificationAccepted​(ApnsPushNotification pushNotification)
        Handles a parsed push notification accepted by a mock server. Note that any field of the parsed push notification may be null.
        Parameters:
        pushNotification - the notification accepted by the server
      • handlePushNotificationRejected

        public abstract void handlePushNotificationRejected​(ApnsPushNotification pushNotification,
                                                            RejectionReason rejectionReason,
                                                            Date deviceTokenExpirationTimestamp)
        Handles a parsed push notification accepted by a mock server. Note that any field of the parsed push notification may be null.
        Parameters:
        pushNotification - the push notification rejected by the server
        rejectionReason - the reason the push notification was rejected by the mock server
        deviceTokenExpirationTimestamp - the time at which the push notification's destination device token expired;