public interface PushNotificationHandler
Push notification handlers process push notifications sent to a
MockApnsServer and decide how the server
should respond to those notifications. Implementers can write handlers to simulate a variety of server behaviors and
error conditions without setting up elaborate pre-conditions.
Push notification handler instances are bound to a specific connection and will always be called by the same thread; as a result, implementations are inherently thread-safe.
- See Also:
void handlePushNotification(Http2Headers headers, ByteBuf payload) throws RejectedNotificationExceptionProcesses a push notification received by a mock server. Implementations should exit normally to indicate that a notification should be accepted by the server. If an implementation throws a
RejectedNotificationException, the server will reject the notification. If implementations throw a
RuntimeException, the server will report an internal server error to clients.
headers- the notification's HTTP/2 headers
payload- the notification's payload; may be empty or
RejectedNotificationException- if the server should reject the push notification for a specific reason