Class MpnSubscriptionInfo
- java.lang.Object
-
- com.lightstreamer.interfaces.metadata.MpnSubscriptionInfo
-
public class MpnSubscriptionInfo extends java.lang.Object
Specifies a Push Notifications subscription, used with MPN-related requests of theMetadataProvider
.
For the actual description of the subscription we rely on a generic descriptor accessible via thegetNotificationFormat()
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.MpnDeviceInfo
getDevice()
Returns 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.
-
-
-
Constructor Detail
-
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 this subscription.notification
- the descriptor of the push notifications format.trigger
- the optional expression that triggers the delivery of push notification.
-
-
Method Detail
-
getDevice
@Nonnull public MpnDeviceInfo getDevice()
Returns 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 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 classjava.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 classjava.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 classjava.lang.Object
- Returns:
- a hash code value for this object.
-
-