Record Class PushReceiptImpl

java.lang.Object
java.lang.Record
com.iizix.server.push.api.PushReceiptImpl
Record Components:
messageID - The message ID the server assigned, never null.
userID - The user ID of the reporting session.
deviceUUID - The device UUID the channel reported, empty when it reported none.
appID - The application ID of the notification, the session's when the report named none.
topic - The Topic of the notification, empty for the application level.
timestamp - When the device recorded the event, by its own clock, epoch milliseconds.
server - The push server ID the notification carried (data.iizi.server), empty when the report names none (SV-5): what the engine's events compare with their own, not part of IPushReceipt.
All Implemented Interfaces:
IPushReceipt

public record PushReceiptImpl(String messageID, long userID, String deviceUUID, String appID, String topic, long timestamp, String server) extends Record implements IPushReceipt
A client's receipt as the Java API reports it (P4-11): built from a SHOWN or CLICKED report of the session's channel, as the session's user.
Author:
Christopher Mindus
  • Constructor Details

    • PushReceiptImpl

      public PushReceiptImpl(String messageID, long userID, String deviceUUID, String appID, String topic, long timestamp)
      Creates a receipt that names no push server.
      Parameters:
      messageID - The message ID the server assigned, never null.
      userID - The user ID of the reporting session.
      deviceUUID - The device UUID the channel reported, empty when it reported none.
      appID - The application ID of the notification.
      topic - The Topic of the notification, empty for the application level.
      timestamp - When the device recorded the event, epoch milliseconds.
    • PushReceiptImpl

      public PushReceiptImpl(String messageID, long userID, String deviceUUID, String appID, String topic, long timestamp, String server)
      Creates an instance of a PushReceiptImpl record class.
      Parameters:
      messageID - the value for the messageID record component
      userID - the value for the userID record component
      deviceUUID - the value for the deviceUUID record component
      appID - the value for the appID record component
      topic - the value for the topic record component
      timestamp - the value for the timestamp record component
      server - the value for the server record component
  • Method Details

    • of

      public static PushReceiptImpl of(PropCnr params, long uid, String deviceUUID, String sessionAppID)
      Builds the receipt of a report.
      Parameters:
      params - The report's parameters: PushChannelProps.P_MESSAGE present and non-empty, PushChannelProps.P_APP_ID, PushChannelProps.P_TOPIC, PushChannelProps.P_TIME, and PushChannelProps.P_SERVER when the device recorded one (SV-5).
      uid - The reporting session's user ID.
      deviceUUID - The device UUID the channel reported, null for none.
      sessionAppID - The session's application ID, taken when the report names none.
      Returns:
      The receipt.
    • action

      public static String action(PropCnr params)
      Gets the action of a CLICKED report.
      Parameters:
      params - The report's parameters.
      Returns:
      The action identity, empty for a click on the notification itself; never null.
    • getMessageID

      public String getMessageID()
      Description copied from interface: IPushReceipt
      Gets the message ID the server assigned when it sent the notification.
      Specified by:
      getMessageID in interface IPushReceipt
      Returns:
      The message ID, a UUID, never null.
    • getUserID

      public long getUserID()
      Description copied from interface: IPushReceipt
      Gets the ID of the user whose device reported.
      Specified by:
      getUserID in interface IPushReceipt
      Returns:
      The user ID, IZS.USERS.uid.
    • getDeviceUUID

      public String getDeviceUUID()
      Description copied from interface: IPushReceipt
      Gets the device UUID of the device that reported.
      Specified by:
      getDeviceUUID in interface IPushReceipt
      Returns:
      The canonical 36-character UUID, never null.
    • getAppID

      public String getAppID()
      Description copied from interface: IPushReceipt
      Gets the application ID the notification was sent for.
      Specified by:
      getAppID in interface IPushReceipt
      Returns:
      The canonical application ID, never null.
    • getTopic

      public String getTopic()
      Description copied from interface: IPushReceipt
      Gets the topic the notification was sent for.
      Specified by:
      getTopic in interface IPushReceipt
      Returns:
      The topic, the empty string for the application level; never null.
    • getTimestamp

      public long getTimestamp()
      Description copied from interface: IPushReceipt
      Gets the time of the event on the device, as the device's clock reported it.
      Specified by:
      getTimestamp in interface IPushReceipt
      Returns:
      Epoch milliseconds.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • messageID

      public String messageID()
      Returns the value of the messageID record component.
      Returns:
      the value of the messageID record component
    • userID

      public long userID()
      Returns the value of the userID record component.
      Returns:
      the value of the userID record component
    • deviceUUID

      public String deviceUUID()
      Returns the value of the deviceUUID record component.
      Returns:
      the value of the deviceUUID record component
    • appID

      public String appID()
      Returns the value of the appID record component.
      Returns:
      the value of the appID record component
    • topic

      public String topic()
      Returns the value of the topic record component.
      Returns:
      the value of the topic record component
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • server

      public String server()
      Returns the value of the server record component.
      Returns:
      the value of the server record component