Interface PushNotificationsMBean


public interface PushNotificationsMBean
At most one PushNotificationsMBean instance exists in the system, to provide information on the activity of the internal MPN Module. It is created at startup by Lightstreamer Server only when the MPN Module, which accomplishes the Push Notification service, is enabled; then it lasts until the shutdown of the Server.

PushNotificationsMBean name:
"com.lightstreamer:type=PushNotifications"
Edition Note:
MPN is an optional feature, available depending on Edition and License Type. To know what features are enabled by your license, please check out the com.lightstreamer.Edition bean.
  • Method Details

    • getCurrentMPNDevices

      java.lang.Integer getCurrentMPNDevices()
      Returns:
      The number of MPN Devices currently served by this Server instance. Only the Devices with at least one active subscription are considered as being served.
      Actually, multiple apps can request Push Notifications for the same physical device; here, by MPN Device we mean the combination of a physical device and an app.
    • getCurrentMPNDeviceListProtected

      java.util.List<java.lang.String> getCurrentMPNDeviceListProtected​(java.lang.Integer max)
      Parameters:
      max - The maximum number of elements to be returned, or null if no limit is requested.
      Returns:
      The list of MPN Devices currently served by this Server instance. Expressed as an ArrayList of Strings, where each String contains an identifier for the MPN Device. Only the Devices with at least one active subscription are considered as being served.
      A maximum number of elements to be returned can be set, to protect the client or to get a sample. When the limit is set, the criteria for the determination of the returned elements are left unspecified.
      See Also:
      getCurrentMPNDevices()
    • getCurrentMPNDeviceList

      java.util.List<java.lang.String> getCurrentMPNDeviceList()
      Returns:
      The list of MPN Devices currently served by this Server instance. Expressed as an ArrayList of Strings, where each String contains an identifier for the MPN Device. Only the Devices with at least one active subscription are considered as being served.
      The property is subject to the <disable_long_list_properties> configuration flag. If leveraged, the returned list will just contain a reminder text.
      See Also:
      getCurrentMPNDeviceListProtected(java.lang.Integer), getCurrentMPNDevices()
    • getMaxMPNDevices

      java.lang.Integer getMaxMPNDevices()
      Returns:
      The maximum number of concurrently served MPN Devices reached in the life of this Server instance. Only the Devices with at least one active subscription are considered as being served.
      See Also:
      getCurrentMPNDevices()
    • getNewStartedMPNDevices

      java.lang.Integer getNewStartedMPNDevices()
      Returns:
      The number of MPN Devices whose service, by this Server instance, has started in the last sampling period. Only the Devices with at least one active subscription are considered as being served.
      See Also:
      getCurrentMPNDevices()
    • getNewTerminatedMPNDevices

      java.lang.Integer getNewTerminatedMPNDevices()
      Returns:
      The number of MPN Devices whose service, by this Server instance, has terminated in the last sampling period. Only the Devices with at least one active subscription are considered as being served.
      See Also:
      getCurrentMPNDevices()
    • getCumulPushNotificationBytes

      java.lang.Long getCumulPushNotificationBytes()
      Returns:
      The total (cumulative) number of bytes related with Push Notifications submitted to the notifier services in the life of the Server. The count only includes the notification payload.
    • getCumulPushNotifications

      java.lang.Long getCumulPushNotifications()
      Returns:
      The total (cumulative) number of Push Notifications sent in the life of the Server.
    • getPushNotificationFrequency

      java.lang.Double getPushNotificationFrequency()
      Returns:
      The frequency of Push Notifications sent in the last sampling period. It is expressed as notifications per second; the value has a three decimal precision.
    • getMaxPushNotificationFrequency

      java.lang.Double getMaxPushNotificationFrequency()
      Returns:
      The maximum frequency of Push Notifications reached in the life of the Server. It is expressed as notifications per second; the value has a three decimal precision.
    • getCurrentPushNotificationThroughputKbps

      java.lang.Double getCurrentPushNotificationThroughputKbps()
      Returns:
      The current global throughput (measured in the last sampling period) related to the submission of Push Notifications to the proper notifier services. The count only includes the notification payload. It is expressed as Kilobits per second; the value has a three decimal precision.
    • getMaxPushNotificationThroughputKbps

      java.lang.Double getMaxPushNotificationThroughputKbps()
      Returns:
      The maximum global throughput (occurred in the life of the Server) related to the submission of Push Notifications to the proper notifier services. The count only includes the notification payload. It is expressed as Kilobits per second; the value has a three decimal precision.
    • getNewFilteredEvents

      java.lang.Integer getNewFilteredEvents()
      Returns:
      The number of filtered events occurred while serving MPN Devices in the last sampling period. Events discarded because of the application of a "trigger" are also included in this count.
    • getCumulFilteredEvents

      java.lang.Long getCumulFilteredEvents()
      Returns:
      The total (cumulative) number of filtered events occurred while serving MPN Devices in the life of the Server. Events discarded because of the application of a "trigger" are also included in this count.
    • getDeviceHandlerPoolQueue

      java.lang.Integer getDeviceHandlerPoolQueue()
      Returns:
      The length of the queue of the tasks waiting to be processed by the optional pool that can be assigned for performing subscriptions and unsubscriptions internally originated by the Push Notification service. If a specific pool is not assigned, these operations are managed by either the Data Adapter specific pool or the SERVER pool; in this case, -1 is returned.
    • getCurrentMPNDevice

      java.lang.String getCurrentMPNDevice​(java.lang.String platformType, java.lang.String applicationId, java.lang.String deviceToken)
      Parameters:
      platformType - specifies a push notifications platform type. See the PlatformType class in the Metadata Adapter interface specifications for details on the available names.
      applicationId - the app ID, also known as the bundle ID. The domain of Application IDs is determined by the Platform.
      deviceToken - the token of the device receiving the push notifications. The domain of Device Tokens is determined by the Platform and possibly by the Application.
      Returns:
      An identifier for an MPN Device whose properties match the supplied ones, or null if none of the MPN Devices currently served by the Push Notification service on this Server instance matches all the properties. Note that only the Devices with at least one active subscription are considered as being served, hence can be addressed. If a MPN Device is found, it is guaranteed to be the only one MPN Device currently served on this Server instance that matches all the properties.
    • getMPNDevicePlatformType

      java.lang.String getMPNDevicePlatformType​(java.lang.String deviceId)
      Parameters:
      deviceId - an identifier, as returned from getCurrentMPNDeviceList(), getCurrentMPNDeviceListProtected(Integer), or getCurrentMPNDevice(java.lang.String, java.lang.String, java.lang.String).
      Returns:
      The Platform associated with the MPN Device specified through the supplied identifier, or null if none of the MPN Devices currently served by the Push Notification service on this Server instance corresponds to the supplied identifier. Note that only the Devices with at least one active subscription are considered as being served, hence can be addressed.
      The returned value is the name of one of the Platforms supported by the Push Notification service. See the PlatformType class in the Metadata Adapter interface specifications for details on the available names.
    • getMPNDeviceApplicationId

      java.lang.String getMPNDeviceApplicationId​(java.lang.String deviceId)
      Parameters:
      deviceId - an identifier, as returned fromgetCurrentMPNDeviceList(), getCurrentMPNDeviceListProtected(Integer), or getCurrentMPNDevice(java.lang.String, java.lang.String, java.lang.String).
      Returns:
      The ID of the Application associated with the MPN Device specified through the supplied identifier, or null if none of the MPN Devices currently served by the Push Notification service on this Server instance corresponds to the supplied identifier. Note that only the Devices with at least one active subscription are considered as being served, hence can be addressed.
      The domain of Application IDs is determined by the Platform.
    • getMPNDeviceToken

      java.lang.String getMPNDeviceToken​(java.lang.String deviceId)
      Parameters:
      deviceId - an identifier, as returned from getCurrentMPNDeviceList(), getCurrentMPNDeviceListProtected(Integer), or getCurrentMPNDevice(java.lang.String, java.lang.String, java.lang.String).
      Returns:
      The Device Token associated with the MPN Device specified through the supplied identifier, or null if none of the MPN Devices currently served by the Push Notification service on this Server instance corresponds to the supplied identifier. Note that only the Devices with at least one active subscription are considered as being served, hence can be addressed.
      The domain of Device Tokens is determined by the Platform and possibly by the Application.
    • getMPNDeviceFromSubscription

      java.lang.String getMPNDeviceFromSubscription​(java.lang.String subscriptionId)
      Parameters:
      subscriptionId - The unique ID of a subscription. Subscriptions are identified by their unique ID in the log and in the database; the ID is also available to the client interface.
      Returns:
      An identifier for an MPN Device to which a specified subscription belongs, or null if the subscription is not found among the devices currently served by the Push Notification service on this Server instance.
    • deleteMPNDevice

      java.lang.Boolean deleteMPNDevice​(java.lang.String deviceId)
      Stops managing a specified MPN Device that is currently served by the Push Notification service in this Server instance. As a consequence, all related subscriptions will be discarded and will no longer be managed by this or other instances. Note that only the Devices with at least one active subscription are considered as being served, hence can be addressed.
      Note that further client requests, if allowed by the Metadata Adapter, may cause the same MPN Device to be managed again.
      Parameters:
      deviceId - an identifier, as returned from getCurrentMPNDeviceList(), getCurrentMPNDeviceListProtected(Integer), or getCurrentMPNDevice(java.lang.String, java.lang.String, java.lang.String).
      Returns:
      True if operation succeeded. False if operation failed.
    • deactivateCurrentModule

      void deactivateCurrentModule()
      Initiates the closure of all operations by the MPN Module, which will be carried out asynchronously. If the module is still in its startup, an attempt to interrupt the startup will be performed instead. Anyway, the module is also immediately replaced by an inactive one. This means that no subscription processing will be performed and any client MPN requests will be refused.
    • getIsModuleActive

      java.lang.Boolean getIsModuleActive()
      Returns:
      True if the MPN Module works normally, i.e. it is not inactive. A module can become inactive upon a startup failure, or a health check failure, or an invocation of deactivateCurrentModule().
    • replaceCurrentModule

      void replaceCurrentModule()
      Initiates the creation and startup of a new module, which will be carried out asynchronously. The current module is also deactivated as with deactivateCurrentModule(). This is done regardless that the current module is working or inactive. When the startup of the new module terminates, the new module will be used; on the other hand, if the startup fails, the module will remain inactive.