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.
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) 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.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.
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) 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 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