Class PushResultImpl

java.lang.Object
com.iizix.server.push.engine.PushResultImpl
All Implemented Interfaces:
PushResult

public final class PushResultImpl extends Object implements PushResult
The result of a send: the plan, the per-outcome tally and the per-target outcomes.

Every matched target is in exactly one bucket; the tally sums to the plan's matched count, which is what makes the result an audit record rather than a success counter.

Author:
Christopher Mindus
  • Method Details

    • getRoutingPlan

      public IRoutingPlan getRoutingPlan()
      Description copied from interface: PushResult
      Gets the routing plan that was executed.
      Specified by:
      getRoutingPlan in interface PushResult
      Returns:
      The routing plan; never null.
    • getOutcomeCounts

      public Map<DeliveryOutcome, Integer> getOutcomeCounts()
      Description copied from interface: PushResult
      Gets the count of subscriptions per DeliveryOutcome. The values sum to IRoutingPlan.getMatchedCount(); every matched subscription is in exactly one bucket.
      Specified by:
      getOutcomeCounts in interface PushResult
      Returns:
      An unmodifiable map from outcome to count; never null.
    • getDeliveredCount

      public int getDeliveredCount()
      Description copied from interface: PushResult
      Gets the count of subscriptions delivered by any tier — the sum of the DeliveryOutcome.DELIVERED_IN_SESSION and DeliveryOutcome.DELIVERED buckets. A convenience over PushResult.getOutcomeCounts().
      Specified by:
      getDeliveredCount in interface PushResult
      Returns:
      The delivered count.
    • isFullyDelivered

      public boolean isFullyDelivered()
      Description copied from interface: PushResult
      Reports whether every matched, in-scope, deliverable subscription was delivered — i.e. no bucket other than the two delivered outcomes and the deliberate exclusions is non-empty. A send with spooled or unreachable targets is not fully delivered, and the operator should expect a later replay.
      Specified by:
      isFullyDelivered in interface PushResult
      Returns:
      true if nothing was left undelivered for a recoverable reason.
    • getTargetOutcomes

      public List<PushResultImpl.TargetOutcome> getTargetOutcomes()
      Gets the per-target outcomes.
      Returns:
      A copy of the list.
    • describeTransports

      public String describeTransports()
      Describes how the targets were sent, for the send line (PA-D-6 of CC-PUSH-ANDROID): per way of sending (PushResultImpl.TargetOutcome.via(), not sent for a target the plan rejected), the count per outcome, in the order the ways first appear.
      Returns:
      For example [FCM project 'iizirun-developer', HTTP 200: DELIVERED=1], or [] when there was no target.
    • toString

      public String toString()
      Gets a string representation: the tally.
      Overrides:
      toString in class Object
      Returns:
      The outcome counts.