public interface MpnDeviceListener
LightstreamerClient
, including
notifications to ClientListener
, SubscriptionListener
, ClientMessageListener
, MpnDeviceListener and MpnSubscriptionListener
will be dispatched by the same thread.Modifier and Type | Method and Description |
---|---|
void |
onListenEnd(MpnDeviceInterface device)
Event handler called when the MpnDeviceListener instance is removed from an MPN device object through
MpnDeviceInterface.removeListener(MpnDeviceListener) .This is the last event to be fired on the listener. |
void |
onListenStart(MpnDeviceInterface device)
Event handler called when the MpnDeviceListener instance is added to an MPN device object through
MpnDeviceInterface.addListener(MpnDeviceListener) .This is the first event to be fired on the listener. |
void |
onRegistered()
Event handler called when an MPN device object has been successfully registered on the server's MPN Module.
This event handler is always called before other events related to the same device. Note that this event can be called multiple times in the life of an MPN device object in case the client disconnects and reconnects. |
void |
onRegistrationFailed(int code,
java.lang.String message)
Event handler called when the server notifies an error while registering an MPN device object.
By implementing this method it is possible to perform recovery actions. |
void |
onResumed()
Event handler called when an MPN device object has been resumed on the server's MPN Module.
An MPN device may be resumed from suspended state if a new device token is provided. Note that in some server clustering configurations this event may not be called. |
void |
onStatusChanged(java.lang.String status,
long timestamp)
Event handler called when the server notifies that an MPN device changed its status.
Note that in some server clustering configurations the status change for the MPN device suspend event may not be called. |
void |
onSubscriptionsUpdated()
Event handled called when the server notifies that the list of MPN subscription associated with an MPN device has been updated.
After registration, the list of pre-existing MPN subscriptions for the MPN device is updated and made avaiable through the LightstreamerClient.getMpnSubscriptions(String) method. |
void |
onSuspended()
Event handler called when an MPN device object has been suspended on the server's MPN Module.
An MPN device may be suspended if errors occur during push notification delivery. Note that in some server clustering configurations this event may not be called. |
void onListenStart(@Nonnull MpnDeviceInterface device)
MpnDeviceInterface.addListener(MpnDeviceListener)
.device
- The MPN device object this instance was added to.void onListenEnd(@Nonnull MpnDeviceInterface device)
MpnDeviceInterface.removeListener(MpnDeviceListener)
.device
- The MPN device object this instance was removed from.void onRegistered()
void onSuspended()
void onResumed()
void onStatusChanged(@Nonnull java.lang.String status, long timestamp)
status
- The new status of the MPN device. It can be one of the following:UNKNOWN
REGISTERED
SUSPENDED
timestamp
- The server-side timestamp of the new device status.MpnDeviceInterface.getStatus()
,
MpnDeviceInterface.getStatusTimestamp()
void onRegistrationFailed(int code, @Nonnull java.lang.String message)
code
- The error code sent by the Server. It can be one of the following:message
- The description of the error sent by the Server; it can be null.void onSubscriptionsUpdated()
LightstreamerClient.getMpnSubscriptions(String)
method.