Interface MockApnsServerListener
-
- All Known Implementing Classes:
ParsingMockApnsServerListenerAdapter
public interface MockApnsServerListener
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 intoApnsPushNotification
instances is the responsibility of the caller, and callers may with to subclassParsingMockApnsServerListenerAdapter
if they need to work withApnsPushNotification
instances instead of raw headers and byte buffers.- Since:
- 0.12
- See Also:
MockApnsServerBuilder.setListener(MockApnsServerListener)
,ParsingMockApnsServerListenerAdapter
-
-
Method Summary
Modifier and Type Method Description void
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, Date deviceTokenExpirationTimestamp)
Indicates that a push notification has been rejected by the mock server.
-
-
-
Method Detail
-
handlePushNotificationAccepted
void handlePushNotificationAccepted(Http2Headers headers, ByteBuf payload)
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, Date 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
-
-