Class MpnDeviceInfo

java.lang.Object
com.lightstreamer.interfaces.metadata.MpnDeviceInfo

public class MpnDeviceInfo extends Object
Specifies a target device for Push Notifications, used with MPN-related requests for the MetadataProvider.
Note that the processing and the authorization of Push Notifications is per-device and per-application. While a physical device is uniquely identified by the platform type and a platform dependent device token, Lightstreamer considers the same device used by two different applications as two different MPN devices. Thus, an MpnDeviceInfo instance uniquely identifies both the physical device and the application for which it is being used.

An MpnDeviceInfo always provides the following identifiers:
  • The platform type.
  • The application ID.
  • The device token.

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

    • MpnDeviceInfo

      public MpnDeviceInfo(@Nonnull MpnPlatformType type, @Nonnull String applicationId, @Nonnull String deviceToken)
      Used by Lightstreamer Kernel to create an MpnDeviceInfo instance.
      Parameters:
      type - platform type of the device.
      applicationId - the application ID, also known as the package name or bundle ID on some platforms.
      deviceToken - the token of the device, also know as the registration ID on some platforms.
  • Method Details

    • getType

      @Nonnull public MpnPlatformType getType()
      Returns the platform type of the device.
      Returns:
      a platform type.
    • getApplicationId

      @Nonnull public String getApplicationId()
      Returns the application ID, also known as the package name or bundle ID on some platforms.
      Returns:
      an application ID.
    • getDeviceToken

      @Nonnull public String getDeviceToken()
      Returns the token of the device, also know as the registration ID on some platforms.
      Returns:
      a device token.
    • toString

      @Nonnull public String toString()
      Returns a string representation of the MpnDeviceInfo. An MpnDeviceInfo object is represented by a juxtaposition of its three properties platform type, application ID and device token, separated by a single "/" character. E.g.:
       Apple/com.lightstreamer.ios.stocklist/8fac[...]fe12
       
      Overrides:
      toString in class Object
      Returns:
      a string representation of the MPN device info.
    • equals

      public boolean equals(@Nullable Object obj)
      Indicates whether some other object is "equal to" this one. Two MpnDeviceInfo 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.