Interface MockApnsServerListener
- All Known Implementing Classes:
ParsingMockApnsServerListenerAdapter
Mock APNs server listeners are notified when push notifications are accepted or rejected by a
MockApnsServer
. Listeners have no effect on a server's handling of push notifications, and are designed for
use in integration testing.
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. Notifications passed to listeners may have missing, incomplete, or nonsense data
regardless of whether they were accepted or rejected, and callers should use appropriate caution. Parsing
notification headers/payloads into ApnsPushNotification
instances is the responsibility
of the caller, and callers may with to subclass ParsingMockApnsServerListenerAdapter
if they need to work
with ApnsPushNotification
instances instead of raw headers and byte buffers.
- Since:
- 0.12
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handlePushNotificationAccepted
(Http2Headers headers, ByteBuf payload) Indicates that a push notification has been accepted by the mock server.void
handlePushNotificationRejected
(Http2Headers headers, ByteBuf payload, RejectionReason rejectionReason, Instant deviceTokenExpirationTimestamp) Indicates that a push notification has been rejected by the mock server.
-
Method Details
-
handlePushNotificationAccepted
Indicates that a push notification has been accepted by the mock server.- Parameters:
headers
- the notification's HTTP/2 headerspayload
- the notification's payload
-
handlePushNotificationRejected
void handlePushNotificationRejected(Http2Headers headers, ByteBuf payload, RejectionReason rejectionReason, Instant deviceTokenExpirationTimestamp) Indicates that a push notification has been rejected by the mock server.- Parameters:
headers
- the notification's HTTP/2 headerspayload
- the notification's payloadrejectionReason
- the reason the push notification was rejected by the mock serverdeviceTokenExpirationTimestamp
- the time at which the push notification's destination device token expired; may benull
if the token has not expired
-