Web Client 8.0.8

ClientMessageListener

ClientMessageListener

Interface to be implemented to listen to LightstreamerClient#sendMessage events reporting a message processing outcome.
Events for these listeners are executed asynchronously with respect to the code that generates them.
Note that it is not necessary to implement all of the interface methods for the listener to be successfully passed to the LightstreamerClient#sendMessage method. On the other hand, if all of the handlers are implemented the library will ensure to call one and only one of them per message.

Constructor

new ClientMessageListener()

This is a dummy constructor not to be used in any case.

Methods

onAbort(originalMessage, sentOnNetwork)

Event handler that is called by Lightstreamer when any notifications of the processing outcome of the related message haven't been received yet and can no longer be received. Typically, this happens after the session has been closed. In this case, the client has no way of knowing the processing outcome and any outcome is possible.

Parameters:
Name Type Description
originalMessage String

the message to which this notification is related.

sentOnNetwork boolean

true if the message was probably sent on the network, false otherwise.
Event if the flag is true, it is not possible to infer whether the message actually reached the Lightstreamer Server or not.

onDeny(originalMessage, code, message)

Event handler that is called by Lightstreamer when the related message has been processed by the Server but the expected processing outcome could not be achieved for any reason.

Parameters:
Name Type Description
originalMessage String

the message to which this notification is related.

code Number

the error code sent by the Server. It can be one of the following:

  • <= 0 - the Metadata Adapter has refused the message; the code value is dependent on the specific Metadata Adapter implementation.
message String

the description of the error sent by the Server.

onDiscarded(originalMessage)

Event handler that is called by Lightstreamer to notify that the related message has been discarded by the Server. This means that the message has not reached the Metadata Adapter and the message next in the sequence is considered enabled for processing.

Parameters:
Name Type Description
originalMessage String

the message to which this notification is related.

onError(originalMessage)

Event handler that is called by Lightstreamer when the related message has been processed by the Server but the processing has failed for any reason. The level of completion of the processing by the Metadata Adapter cannot be determined.

Parameters:
Name Type Description
originalMessage String

the message to which this notification is related.

onProcessed(originalMessage)

Event handler that is called by Lightstreamer when the related message has been processed by the Server with success.

Parameters:
Name Type Description
originalMessage String

the message to which this notification is related.