Class DeliveryTarget

java.lang.Object
com.iizix.server.push.engine.DeliveryTarget

public final class DeliveryTarget extends Object
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 Details

    • getUid

      public long getUid()
      Gets the user ID.
      Returns:
      The unique user ID.
    • getAppId

      public String getAppId()
      Gets the application ID.
      Returns:
      The application ID, * for iiziRun.
    • getTopic

      public String getTopic()
      Gets the Topic.
      Returns:
      The Topic, empty for the application-level subscription.
    • getDeviceUuid

      public String getDeviceUuid()
      Gets the device UUID.
      Returns:
      The device UUID, null when not known.
    • isInSession

      public boolean isInSession()
      Checks if this is an in-session target.
      Returns:
      true for a live session, false for a device.
    • getTransport

      public PushTransport getTransport()
      Gets the transport of a device target.
      Returns:
      The transport, null for an in-session target.
    • getSubscription

      public SubscriptionRecord getSubscription()
      Gets the stored subscription of a device target.
      Returns:
      The subscription, null for an in-session target.
    • getSession

      public IClientSessionGyro getSession()
      Gets the live session of an in-session target.
      Returns:
      The client session, null for a device target.
    • getLocation

      public RegionLocation getLocation()
      Gets the location.
      Returns:
      The location, null when unknown.
    • getRegion

      public IRegionNode 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

      public String 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

      public String toString()
      Gets a string representation.
      Overrides:
      toString in class Object
      Returns:
      The target dimensions and method.