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 ofIPushReceipt.
- 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 Summary
ConstructorsConstructorDescriptionPushReceiptImpl(String messageID, long userID, String deviceUUID, String appID, String topic, long timestamp) Creates a receipt that names no push server.PushReceiptImpl(String messageID, long userID, String deviceUUID, String appID, String topic, long timestamp, String server) Creates an instance of aPushReceiptImplrecord class.Method Summary
Modifier and TypeMethodDescriptionstatic StringGets the action of aCLICKEDreport.appID()Returns the value of theappIDrecord component.Returns the value of thedeviceUUIDrecord component.final booleanIndicates whether some other object is "equal to" this one.getAppID()Gets the application ID the notification was sent for.Gets the device UUID of the device that reported.Gets the message ID the server assigned when it sent the notification.longGets the time of the event on the device, as the device's clock reported it.getTopic()Gets the topic the notification was sent for.longGets the ID of the user whose device reported.final inthashCode()Returns a hash code value for this object.Returns the value of themessageIDrecord component.static PushReceiptImplBuilds the receipt of a report.server()Returns the value of theserverrecord component.longReturns the value of thetimestamprecord component.topic()Returns the value of thetopicrecord component.final StringtoString()Returns a string representation of this record class.longuserID()Returns the value of theuserIDrecord component.
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 aPushReceiptImplrecord class.- Parameters:
messageID- the value for themessageIDrecord componentuserID- the value for theuserIDrecord componentdeviceUUID- the value for thedeviceUUIDrecord componentappID- the value for theappIDrecord componenttopic- the value for thetopicrecord componenttimestamp- the value for thetimestamprecord componentserver- the value for theserverrecord component
Method Details
of
Builds the receipt of a report.- Parameters:
params- The report's parameters:PushChannelProps.P_MESSAGEpresent and non-empty,PushChannelProps.P_APP_ID,PushChannelProps.P_TOPIC,PushChannelProps.P_TIME, andPushChannelProps.P_SERVERwhen 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
getMessageID
Description copied from interface:IPushReceiptGets the message ID the server assigned when it sent the notification.- Specified by:
getMessageIDin interfaceIPushReceipt- Returns:
- The message ID, a UUID, never
null.
getUserID
public long getUserID()Description copied from interface:IPushReceiptGets the ID of the user whose device reported.- Specified by:
getUserIDin interfaceIPushReceipt- Returns:
- The user ID,
IZS.USERS.uid.
getDeviceUUID
Description copied from interface:IPushReceiptGets the device UUID of the device that reported.- Specified by:
getDeviceUUIDin interfaceIPushReceipt- Returns:
- The canonical 36-character UUID, never
null.
getAppID
Description copied from interface:IPushReceiptGets the application ID the notification was sent for.- Specified by:
getAppIDin interfaceIPushReceipt- Returns:
- The canonical application ID, never
null.
getTopic
Description copied from interface:IPushReceiptGets the topic the notification was sent for.- Specified by:
getTopicin interfaceIPushReceipt- Returns:
- The topic, the empty string for the application level; never
null.
getTimestamp
public long getTimestamp()Description copied from interface:IPushReceiptGets the time of the event on the device, as the device's clock reported it.- Specified by:
getTimestampin interfaceIPushReceipt- Returns:
- Epoch milliseconds.
toString
hashCode
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.messageID
userID
deviceUUID
Returns the value of thedeviceUUIDrecord component.- Returns:
- the value of the
deviceUUIDrecord component
appID
topic
timestamp
server