Class DeliveryTarget
java.lang.Object
com.iizix.server.push.engine.DeliveryTarget
One resolved delivery target: a device or a live client session of one user for one application and Topic, carrying its delivery method and what that method needs.
The method is a property of the target. A resolution never expresses "deliver by FCM": it yields targets, each of which is reached by whatever it is - a Web Push subscription by PushTransport.VAPID, a Firebase token by PushTransport.FCM, a live session in-session. Location filters the target set; it does not choose methods.
Location is exact for a session and best-effort for a stored token. A live session has a real connection with a real remote address, resolved now. A stored subscription only has the address the device last presented to this server, resolved when it was seen; the device may have moved since, and a regional send is therefore not a guarantee for an offline device. isExactLocation() tells the two apart.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptiongetAppId()Gets the application ID.Gets the device UUID.Gets the location.Gets the region node.Gets the live session of an in-session target.Gets the spool target key of a device target: what the spool stores so that a replay can look the subscription up again and send to its current endpoint.Gets the stored subscription of a device target.getTopic()Gets the Topic.Gets the transport of a device target.longgetUid()Gets the user ID.booleanChecks if the location is exact.booleanChecks if this is an in-session target.toString()Gets a string representation.
Method Details
getUid
public long getUid()Gets the user ID.- Returns:
- The unique user ID.
getAppId
getTopic
Gets the Topic.- Returns:
- The Topic, empty for the application-level subscription.
getDeviceUuid
isInSession
public boolean isInSession()Checks if this is an in-session target.- Returns:
- true for a live session, false for a device.
getTransport
Gets the transport of a device target.- Returns:
- The transport, null for an in-session target.
getSubscription
Gets the stored subscription of a device target.- Returns:
- The subscription, null for an in-session target.
getSession
Gets the live session of an in-session target.- Returns:
- The client session, null for a device target.
getLocation
getRegion
Gets the region node.- Returns:
- The region node, null when the location is unknown.
isExactLocation
public boolean isExactLocation()Checks if the location is exact.- Returns:
- true when resolved from a live connection now, false when it is the address the device last presented and may be stale.
getSpoolKey
Gets the spool target key of a device target: what the spool stores so that a replay can look the subscription up again and send to its current endpoint.- Returns:
- The key, or null for an in-session target.
toString