Class MpnDeviceInfo
java.lang.Object
com.lightstreamer.adapters.remote.MpnDeviceInfo
public class MpnDeviceInfo
extends java.lang.Object
Specifies a target device for Push Notifications, used with MPN-related requests for the
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:
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).
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 Summary
Constructors Constructor Description MpnDeviceInfo(MpnPlatformType type, java.lang.String applicationId, java.lang.String deviceToken)
Used by Lightstreamer to provide a MpnDeviceInfo instance to the MPN-related methods. -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.java.lang.String
getApplicationId()
Returns the application ID, also known as the package name or bundle ID on some platforms.java.lang.String
getDeviceToken()
Returns the token of the device, also know as the registration ID on some platforms.MpnPlatformType
getType()
Returns the platform type of the device.int
hashCode()
Returns a hash code value for the object.java.lang.String
toString()
Returns a string representation of the MpnDeviceInfo.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
MpnDeviceInfo
public MpnDeviceInfo(@Nonnull MpnPlatformType type, @Nonnull java.lang.String applicationId, @Nonnull java.lang.String deviceToken)Used by Lightstreamer to provide a MpnDeviceInfo instance to the MPN-related methods.- Parameters:
type
- Platform type of the device.applicationId
- The app ID, also known as the bundle ID on some platforms.deviceToken
- The token of the device.
-
-
Method Details
-
getType
Returns the platform type of the device.- Returns:
- a platform type.
-
getApplicationId
@Nonnull public final java.lang.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 final java.lang.String getDeviceToken()Returns the token of the device, also know as the registration ID on some platforms.- Returns:
- a device token.
-
toString
@Nonnull public java.lang.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 classjava.lang.Object
- Returns:
- a string representation of the MPN device info.
-
equals
public boolean equals(@Nullable java.lang.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 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.
-