Class MpnSubscriptionInfo

java.lang.Object
com.lightstreamer.adapters.remote.MpnSubscriptionInfo

public class MpnSubscriptionInfo extends Object
Specifies a Push Notifications subscription, used with MPN-related requests of the MetadataProvider.
For the actual description of the subscription we rely on a generic descriptor accessible via the getNotificationFormat() getter, where the structure of the descriptor depends on the platform.
Edition Note:
Push Notifications is an optional feature, available depending on Edition and License Type. To know what features are enabled by your license, please see the License tab of the Monitoring Dashboard (by default, available at /dashboard).
  • Constructor Details

    • MpnSubscriptionInfo

      public MpnSubscriptionInfo(@Nonnull MpnDeviceInfo device, @Nonnull String notification, @Nonnull String trigger)
      Used by Lightstreamer to create a MpnSubscriptionInfo instance.
      Parameters:
      device - The MPN device of the push notifications.
      notification - the descriptor of the push notifications format.
      trigger - The expression the updates are checked against to trigger the notification.
  • Method Details

    • getDevice

      @Nonnull public final MpnDeviceInfo getDevice()
      Gets the MPN device of this subscription.
      Returns:
      the MPN device of this subscription.
    • getNotificationFormat

      @Nonnull public String getNotificationFormat()
      Returns the descriptor of the push notifications format of this subscription.
      The structure of the format descriptor depends on the platform type and it is represented in json.
      Returns:
      a descriptor of the push notifications format in json.
    • getTrigger

      @Nonnull public final String getTrigger()
      Returns the optional expression that triggers the delivery of push notification.
      Returns:
      a trigger expression, or null if not specified.
    • toString

      @Nonnull public String toString()
      Returns a string representation of the MpnSubscriptionInfo. An MpnSubscriptionInfo object is represented by its three properties device, trigger and notification format, prefixed by their name and on separate lines. E.g.:
       device=Apple/com.lightstreamer.ios.stocklist/8fac[...]fe12\n
       trigger=Double.parseDouble(${last_price}) >= 50.0\n
       notificationFormat={aps={badge=AUTO, alert=Price is over 50$, sound=Default}}\n
       
      Overrides:
      toString in class Object
      Returns:
      a string representation of the MpnSubscriptionInfo.
    • equals

      public boolean equals(@Nullable Object obj)
      Indicates whether some other object is "equal to" this one. Two MpnSubscriptionInfo objects are equal if their three properties are equal.
      Overrides:
      equals in class Object
      Returns:
      true if this object is equal to the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.