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 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 a PushSubscriptionInfoImpl record class.
      Parameters:
      userID - the value for the userID record component
      userName - the value for the userName record component
      appID - the value for the appID record component
      topic - the value for the topic record component
      deviceUUID - the value for the deviceUUID record component
      transport - the value for the transport record component
      created - the value for the created record component
      lastSeen - the value for the lastSeen record component
      userAgent - the value for the userAgent record component
  • Method Details

    • of

      public static PushSubscriptionInfoImpl of(SubscriptionRecord r, String userName)
      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: IPushSubscriptionInfo
      Gets the ID of the user the subscription belongs to.
      Specified by:
      getUserID in interface IPushSubscriptionInfo
      Returns:
      The user ID, IZS.USERS.uid.
    • getUserName

      public String getUserName()
      Description copied from interface: IPushSubscriptionInfo
      Gets the name of the user the subscription belongs to.
      Specified by:
      getUserName in interface IPushSubscriptionInfo
      Returns:
      The user name, never null.
    • getAppID

      public String getAppID()
      Description copied from interface: IPushSubscriptionInfo
      Gets the application ID, canonical as stored.
      Specified by:
      getAppID in interface IPushSubscriptionInfo
      Returns:
      The application ID, * for the server itself; never null.
    • getTopic

      public String getTopic()
      Description copied from interface: IPushSubscriptionInfo
      Gets the topic.
      Specified by:
      getTopic in interface IPushSubscriptionInfo
      Returns:
      The topic, the empty string for the application-level subscription; never null.
    • getDeviceUUID

      public String getDeviceUUID()
      Description copied from interface: IPushSubscriptionInfo
      Gets the device UUID the subscription was registered from, the X-iizi header of the PN HTTP API.
      Specified by:
      getDeviceUUID in interface IPushSubscriptionInfo
      Returns:
      The canonical 36-character UUID, never null.
    • getTransport

      public PushTransport getTransport()
      Description copied from interface: IPushSubscriptionInfo
      Gets the transport that reaches the device.
      Specified by:
      getTransport in interface IPushSubscriptionInfo
      Returns:
      The transport, never null.
    • getCreated

      public long getCreated()
      Description copied from interface: IPushSubscriptionInfo
      Gets the time the subscription was first stored.
      Specified by:
      getCreated in interface IPushSubscriptionInfo
      Returns:
      Epoch milliseconds.
    • getLastSeen

      public long getLastSeen()
      Description copied from interface: IPushSubscriptionInfo
      Gets the time the device last contacted the PN HTTP API.
      Specified by:
      getLastSeen in interface IPushSubscriptionInfo
      Returns:
      Epoch milliseconds.
    • getUserAgent

      public String getUserAgent()
      Description copied from interface: IPushSubscriptionInfo
      Gets the user agent the device reported when it subscribed.
      Specified by:
      getUserAgent in interface IPushSubscriptionInfo
      Returns:
      The user agent text, never null, possibly empty.
    • 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.
    • userID

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

      public String userName()
      Returns the value of the userName record component.
      Returns:
      the value of the userName 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
    • deviceUUID

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

      public PushTransport transport()
      Returns the value of the transport record component.
      Returns:
      the value of the transport record component
    • created

      public long created()
      Returns the value of the created record component.
      Returns:
      the value of the created record component
    • lastSeen

      public long lastSeen()
      Returns the value of the lastSeen record component.
      Returns:
      the value of the lastSeen record component
    • userAgent

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