io.github.yawenok.apns.http2.impl.model.ResponseFutureCallback Maven / Gradle / Ivy
package io.github.yawenok.apns.http2.impl.model;
import io.github.yawenok.apns.http2.Notification;
import io.github.yawenok.apns.http2.NotificationResponse;
import io.github.yawenok.apns.http2.concurrent.FutureCallback;
public class ResponseFutureCallback {
private final Notification notification;
private final FutureCallback futureCallback;
public ResponseFutureCallback(Notification notification, FutureCallback futureCallback) {
this.notification = notification;
this.futureCallback = futureCallback;
}
public void completed(NotificationResponse notificationResponse) {
if (futureCallback != null) {
futureCallback.completed(notification, notificationResponse);
}
}
public void failed(Exception e) {
if (futureCallback != null) {
futureCallback.failed(notification, e);
}
}
public void cancelled() {
if (futureCallback != null) {
futureCallback.cancelled(notification);
}
}
}