Record Class PushSubscriptionInfoImpl
java.lang.Object
java.lang.Record
com.iizix.server.push.api.PushSubscriptionInfoImpl
- Record Components:
userID- The user ID.userName- The user name, never null, empty when unknown.appID- The canonical application ID.topic- The Topic, empty for the application level.deviceUUID- The device UUID.transport- The transport.created- Creation time, epoch milliseconds.lastSeen- Last-seen time, epoch milliseconds.userAgent- The user agent, never null.
- All Implemented Interfaces:
IPushSubscriptionInfo
public record PushSubscriptionInfoImpl(long userID, String userName, String appID, String topic, String deviceUUID, PushTransport transport, long created, long lastSeen, String userAgent) extends Record implements IPushSubscriptionInfo
One stored subscription as the Java API lists it: the row without its key material, endpoint, token or address.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionPushSubscriptionInfoImpl(long userID, String userName, String appID, String topic, String deviceUUID, PushTransport transport, long created, long lastSeen, String userAgent) Creates an instance of aPushSubscriptionInfoImplrecord class.Method Summary
Modifier and TypeMethodDescriptionappID()Returns the value of theappIDrecord component.longcreated()Returns the value of thecreatedrecord component.Returns the value of thedeviceUUIDrecord component.final booleanIndicates whether some other object is "equal to" this one.getAppID()Gets the application ID, canonical as stored.longGets the time the subscription was first stored.Gets the device UUID the subscription was registered from, theX-iiziheader of the PN HTTP API.longGets the time the device last contacted the PN HTTP API.getTopic()Gets the topic.Gets the transport that reaches the device.Gets the user agent the device reported when it subscribed.longGets the ID of the user the subscription belongs to.Gets the name of the user the subscription belongs to.final inthashCode()Returns a hash code value for this object.longlastSeen()Returns the value of thelastSeenrecord component.static PushSubscriptionInfoImplof(SubscriptionRecord r, String userName) Builds the info of a row.topic()Returns the value of thetopicrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransportrecord component.Returns the value of theuserAgentrecord component.longuserID()Returns the value of theuserIDrecord component.userName()Returns the value of theuserNamerecord component.
Constructor Details
PushSubscriptionInfoImpl
public PushSubscriptionInfoImpl(long userID, String userName, String appID, String topic, String deviceUUID, PushTransport transport, long created, long lastSeen, String userAgent) Creates an instance of aPushSubscriptionInfoImplrecord class.- Parameters:
userID- the value for theuserIDrecord componentuserName- the value for theuserNamerecord componentappID- the value for theappIDrecord componenttopic- the value for thetopicrecord componentdeviceUUID- the value for thedeviceUUIDrecord componenttransport- the value for thetransportrecord componentcreated- the value for thecreatedrecord componentlastSeen- the value for thelastSeenrecord componentuserAgent- the value for theuserAgentrecord component
Method Details
of
Builds the info of a row.- Parameters:
r- The row.userName- The user name, null for unknown.- Returns:
- The info.
getUserID
public long getUserID()Description copied from interface:IPushSubscriptionInfoGets the ID of the user the subscription belongs to.- Specified by:
getUserIDin interfaceIPushSubscriptionInfo- Returns:
- The user ID,
IZS.USERS.uid.
getUserName
Description copied from interface:IPushSubscriptionInfoGets the name of the user the subscription belongs to.- Specified by:
getUserNamein interfaceIPushSubscriptionInfo- Returns:
- The user name, never
null.
getAppID
Description copied from interface:IPushSubscriptionInfoGets the application ID, canonical as stored.- Specified by:
getAppIDin interfaceIPushSubscriptionInfo- Returns:
- The application ID,
*for the server itself; nevernull.
getTopic
Description copied from interface:IPushSubscriptionInfoGets the topic.- Specified by:
getTopicin interfaceIPushSubscriptionInfo- Returns:
- The topic, the empty string for the application-level subscription; never
null.
getDeviceUUID
Description copied from interface:IPushSubscriptionInfoGets the device UUID the subscription was registered from, theX-iiziheader of the PN HTTP API.- Specified by:
getDeviceUUIDin interfaceIPushSubscriptionInfo- Returns:
- The canonical 36-character UUID, never
null.
getTransport
Description copied from interface:IPushSubscriptionInfoGets the transport that reaches the device.- Specified by:
getTransportin interfaceIPushSubscriptionInfo- Returns:
- The transport, never
null.
getCreated
public long getCreated()Description copied from interface:IPushSubscriptionInfoGets the time the subscription was first stored.- Specified by:
getCreatedin interfaceIPushSubscriptionInfo- Returns:
- Epoch milliseconds.
getLastSeen
public long getLastSeen()Description copied from interface:IPushSubscriptionInfoGets the time the device last contacted the PN HTTP API.- Specified by:
getLastSeenin interfaceIPushSubscriptionInfo- Returns:
- Epoch milliseconds.
getUserAgent
Description copied from interface:IPushSubscriptionInfoGets the user agent the device reported when it subscribed.- Specified by:
getUserAgentin interfaceIPushSubscriptionInfo- Returns:
- The user agent text, never
null, possibly empty.
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.userID
userName
appID
topic
deviceUUID
Returns the value of thedeviceUUIDrecord component.- Returns:
- the value of the
deviceUUIDrecord component
transport
created
lastSeen
userAgent