Class MpnSubscriptionInfo

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

public class MpnSubscriptionInfo
extends java.lang.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 Summary

    Constructors
    Constructor Description
    MpnSubscriptionInfo​(MpnDeviceInfo device, java.lang.String notification, java.lang.String trigger)
    Used by Lightstreamer to create a MpnSubscriptionInfo instance.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object obj)
    Indicates whether some other object is "equal to" this one.
    MpnDeviceInfo getDevice()
    Gets the MPN device of this subscription.
    java.lang.String getNotificationFormat()
    Returns the descriptor of the push notifications format of this subscription.
    java.lang.String getTrigger()
    Returns the optional expression that triggers the delivery of push notification.
    int hashCode()
    Returns a hash code value for the object.
    java.lang.String toString()
    Returns a string representation of the MpnSubscriptionInfo.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MpnSubscriptionInfo

      public MpnSubscriptionInfo​(@Nonnull MpnDeviceInfo device, @Nonnull java.lang.String notification, @Nonnull java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.Object
      Returns:
      a string representation of the MpnSubscriptionInfo.
    • equals

      public boolean equals​(@Nullable java.lang.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 java.lang.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 java.lang.Object
      Returns:
      a hash code value for this object.