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.
MockApnsServerBuilder.setListener(MockApnsServerListener)
Constructor and Description |
---|
ParsingMockApnsServerListenerAdapter() |
Modifier and Type | Method and Description |
---|---|
abstract void |
handlePushNotificationAccepted(ApnsPushNotification pushNotification)
Handles a parsed push notification accepted by a mock server.
|
void |
handlePushNotificationAccepted(Http2Headers headers,
ByteBuf payload)
Parses a push notification accepted by a mock APNs server into an
ApnsPushNotification instance for
further processing by
handlePushNotificationAccepted(ApnsPushNotification) . |
abstract void |
handlePushNotificationRejected(ApnsPushNotification pushNotification,
RejectionReason rejectionReason,
Date deviceTokenExpirationTimestamp)
Handles a parsed push notification accepted by a mock server.
|
void |
handlePushNotificationRejected(Http2Headers headers,
ByteBuf payload,
RejectionReason rejectionReason,
Date deviceTokenExpirationTimestamp)
Parses a push notification rejected by a mock APNs server into an
ApnsPushNotification instance for
further processing by
handlePushNotificationRejected(ApnsPushNotification, RejectionReason, Date) . |
public ParsingMockApnsServerListenerAdapter()
public void handlePushNotificationAccepted(Http2Headers headers, ByteBuf payload)
ApnsPushNotification
instance for
further processing by
handlePushNotificationAccepted(ApnsPushNotification)
.handlePushNotificationAccepted
in interface MockApnsServerListener
headers
- the notification's HTTP/2 headerspayload
- the notification's payloadpublic abstract void handlePushNotificationAccepted(ApnsPushNotification pushNotification)
null
.pushNotification
- the notification accepted by the serverpublic void handlePushNotificationRejected(Http2Headers headers, ByteBuf payload, RejectionReason rejectionReason, Date deviceTokenExpirationTimestamp)
ApnsPushNotification
instance for
further processing by
handlePushNotificationRejected(ApnsPushNotification, RejectionReason, Date)
.handlePushNotificationRejected
in interface MockApnsServerListener
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;public abstract void handlePushNotificationRejected(ApnsPushNotification pushNotification, RejectionReason rejectionReason, Date deviceTokenExpirationTimestamp)
null
.pushNotification
- the push notification rejected by the serverrejectionReason
- the reason the push notification was rejected by the mock serverdeviceTokenExpirationTimestamp
- the time at which the push notification's destination device token expired;Copyright © 2013–2018 Turo. All rights reserved.