Record Class SubscriptionRecord
java.lang.Object
java.lang.Record
com.iizix.server.push.engine.store.SubscriptionRecord
- Record Components:
uid- The user ID (UserInfoBase.id).appId- The application ID as validated byUtilities.getValidName, or*for the iiziRun subscriptions of the server.topic- The Topic, empty (never null) for the application-level subscription.deviceUuid- The device UUID in canonical 36-character form.transport- The transport, never null; a stored ordinal outside the constant set is never loaded as a record.subId- The transport's subscription: the JSON of a browserPushSubscriptionfor VAPID, the token string for FCM and APNS.domain- The host name the client used to reach this server.userAgent- The client's user agent string, may be empty.created- Creation time, milliseconds since the epoch.lastSeen- When the device last presented this subscription, milliseconds since the epoch.lastIp- The remote address the device last presented, null when unknown.region- The region code the last address resolved to, null when unknown or not yet resolved.vapidKey- The fingerprint (VAPIDKeys.fingerprint) of the VAPID public key a Browser row was made under, null for an FCM row and for a row stored before the column existed (B-10a, PUSH-CLUSTER-DESIGN 3.3).fcmProject- The Firebase project an FCM row was made under, null for a Browser row and for a row stored before the column existed (B-10a).
public record SubscriptionRecord(long uid, String appId, String topic, String deviceUuid, PushTransport transport, String subId, String domain, String userAgent, long created, long lastSeen, String lastIp, String region, String vapidKey, String fcmProject) extends Record
One row of the subscription table.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionSubscriptionRecord(long uid, String appId, String topic, String deviceUuid, PushTransport transport, String subId, String domain, String userAgent, long created, long lastSeen, String lastIp, String region) Constructor of a record without the credentials it was made under:vapidKeyandfcmProjectnull, as a row stored before B-10a reads.SubscriptionRecord(long uid, String appId, String topic, String deviceUuid, PushTransport transport, String subId, String domain, String userAgent, long created, long lastSeen, String lastIp, String region, String vapidKey, String fcmProject) Creates an instance of aSubscriptionRecordrecord 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.domain()Returns the value of thedomainrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefcmProjectrecord component.final inthashCode()Returns a hash code value for this object.lastIp()Returns the value of thelastIprecord component.longlastSeen()Returns the value of thelastSeenrecord component.static String[]parseSpoolKey(String key) Parses a spool key.region()Returns the value of theregionrecord component.spoolKey()Gets the spool key: what the spool stores for a pending delivery so that a replay can look this subscription up again by its identity and send to whatever endpoint it has then.subId()Returns the value of thesubIdrecord component.topic()Returns the value of thetopicrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransportrecord component.longuid()Returns the value of theuidrecord component.Returns the value of theuserAgentrecord component.vapidKey()Returns the value of thevapidKeyrecord component.
Constructor Details
SubscriptionRecord
public SubscriptionRecord(long uid, String appId, String topic, String deviceUuid, PushTransport transport, String subId, String domain, String userAgent, long created, long lastSeen, String lastIp, String region) Constructor of a record without the credentials it was made under:vapidKeyandfcmProjectnull, as a row stored before B-10a reads.- Parameters:
uid- The user ID.appId- The application ID,*for iiziRun.topic- The Topic, empty for the application-level subscription.deviceUuid- The device UUID.transport- The transport.subId- The transport's subscription.domain- The host name the client used.userAgent- The user agent, may be empty.created- Creation time, milliseconds since the epoch.lastSeen- Last-seen time, milliseconds since the epoch.lastIp- The last remote address, null when unknown.region- The region code, null when unknown.
SubscriptionRecord
public SubscriptionRecord(long uid, String appId, String topic, String deviceUuid, PushTransport transport, String subId, String domain, String userAgent, long created, long lastSeen, String lastIp, String region, String vapidKey, String fcmProject) Creates an instance of aSubscriptionRecordrecord class.- Parameters:
uid- the value for theuidrecord componentappId- the value for theappIdrecord componenttopic- the value for thetopicrecord componentdeviceUuid- the value for thedeviceUuidrecord componenttransport- the value for thetransportrecord componentsubId- the value for thesubIdrecord componentdomain- the value for thedomainrecord componentuserAgent- the value for theuserAgentrecord componentcreated- the value for thecreatedrecord componentlastSeen- the value for thelastSeenrecord componentlastIp- the value for thelastIprecord componentregion- the value for theregionrecord componentvapidKey- the value for thevapidKeyrecord componentfcmProject- the value for thefcmProjectrecord component
Method Details
spoolKey
Gets the spool key: what the spool stores for a pending delivery so that a replay can look this subscription up again by its identity and send to whatever endpoint it has then.- Returns:
uid|appId|topic|deviceUuid.
parseSpoolKey
Parses a spool key.- Parameters:
key- The key fromspoolKey().- Returns:
- The four parts: uid, appId, topic, deviceUuid; or null when the key is malformed.
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.uid
appId
topic
deviceUuid
Returns the value of thedeviceUuidrecord component.- Returns:
- the value of the
deviceUuidrecord component
transport
subId
domain
userAgent
created
lastSeen
lastIp
region
vapidKey
fcmProject
Returns the value of thefcmProjectrecord component.- Returns:
- the value of the
fcmProjectrecord component