|
| 1 | +/* |
| 2 | + * Copyright (c) 2025 Jon Chambers |
| 3 | + * |
| 4 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 | + * of this software and associated documentation files (the "Software"), to deal |
| 6 | + * in the Software without restriction, including without limitation the rights |
| 7 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 8 | + * copies of the Software, and to permit persons to whom the Software is |
| 9 | + * furnished to do so, subject to the following conditions: |
| 10 | + * |
| 11 | + * The above copyright notice and this permission notice shall be included in |
| 12 | + * all copies or substantial portions of the Software. |
| 13 | + * |
| 14 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 20 | + * THE SOFTWARE. |
| 21 | + */ |
| 22 | + |
| 23 | +package com.eatthepath.pushy.apns; |
| 24 | + |
| 25 | +import java.util.Optional; |
| 26 | +import java.util.UUID; |
| 27 | + |
| 28 | +public interface BroadcastPushNotificationResponse<T extends ApnsBroadcastPushNotification> { |
| 29 | + |
| 30 | + /** |
| 31 | + * Returns the original broadcast push notification ent to the APNs server. |
| 32 | + * |
| 33 | + * @return the original broadcast push notification ent to the APNs server |
| 34 | + */ |
| 35 | + T getBroadcastPushNotification(); |
| 36 | + |
| 37 | + /** |
| 38 | + * Indicates whether the broadcast push notification was accepted by the APNs server. |
| 39 | + * |
| 40 | + * @return {@code true} if the broadcast push notification was accepted or {@code false} if it was rejected |
| 41 | + */ |
| 42 | + boolean isAccepted(); |
| 43 | + |
| 44 | + /** |
| 45 | + * Returns the ID assigned to this push notification by the APNs server. |
| 46 | + * |
| 47 | + * @return the ID assigned to this push notification by the APNs server |
| 48 | + */ |
| 49 | + UUID getApnsRequestId(); |
| 50 | + |
| 51 | + /** |
| 52 | + * Returns a unique identifier assigned by the APNs server. Note that this identifier is distinct from the identifier |
| 53 | + * returned by {@link #getApnsRequestId()}. As the documentation notes: |
| 54 | + * |
| 55 | + * <blockquote>Specify a unique identifier when raising troubleshooting requests with Apple.</blockquote> |
| 56 | + * |
| 57 | + * @return the unique identifier assigned by the APNs server |
| 58 | + */ |
| 59 | + UUID getApnsUniqueId(); |
| 60 | + |
| 61 | + /** |
| 62 | + * Returns the HTTP status code reported by the APNs server. |
| 63 | + * |
| 64 | + * @return the HTTP status code reported by the APNs server |
| 65 | + */ |
| 66 | + int getStatusCode(); |
| 67 | + |
| 68 | + /** |
| 69 | + * Returns the reason for rejection reported by the APNs gateway. If the notification was accepted, the rejection |
| 70 | + * reason will be {@code null}. |
| 71 | + * |
| 72 | + * @return the reason for rejection reported by the APNs gateway, or empty if the notification was not rejected |
| 73 | + */ |
| 74 | + Optional<String> getRejectionReason(); |
| 75 | +} |
0 commit comments