Interface IPushTransport
- All Known Implementing Classes:
ApnsTransport, FcmTransport, VapidTransport
public interface IPushTransport
A device push transport: the leg that hands a notification to a third-party store-and-forward service for one stored subscription.
A transport is chosen by the subscription's SubscriptionRecord.transport(), never by the notification. It is configured per application, because the credentials - a VAPID key pair, a Firebase project and service account - live in the application's .iiziPush container; * is the iiziSystem application.
Implementations are thread-safe: the engine calls send(SubscriptionRecord, PushMessage, long, DeliveryUrgency) from many virtual threads at once, bounded by its admission semaphore.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases the transport's resources.getKind()Gets the transport kind.Gets whether this transport can send for an application.send(SubscriptionRecord subscription, PushMessage message, long ttlMillis, DeliveryUrgency urgency) Sends a notification to one subscription.
Method Details
getKind
getState
Gets whether this transport can send for an application.- Parameters:
appId- The application ID,*for iiziRun.- Returns:
- The state, never null.
send
TransportResult send(SubscriptionRecord subscription, PushMessage message, long ttlMillis, DeliveryUrgency urgency) Sends a notification to one subscription. Blocks the calling (virtual) thread until the push service has answered or the request timed out.- Parameters:
subscription- The subscription.message- The notification.ttlMillis- The effective time-to-live in milliseconds, already defaulted and clamped by the engine; converted to seconds at the header only.urgency- The effective urgency.- Returns:
- The result, never null; a failure is an outcome, never an exception.
dispose
void dispose()Releases the transport's resources.