com.lightstreamer.ls_client
Class MessageInfo

java.lang.Object
  extended by com.lightstreamer.ls_client.MessageInfo

public class MessageInfo
extends java.lang.Object

A Message object that will be sent to a Lightstreamer Server through a call to LSClient.sendMessage(MessageInfo,SendMessageListener). The class contains the message string, the sequence to which such message is associated and a timeout to wait before the server declares lost the previous message in sequence.


Field Summary
static java.lang.String UNORDERED_MESSAGES
          Constant representing the special sequence name to be used to prevent the sequential management of the messages on the server.
 
Constructor Summary
MessageInfo(java.lang.String message, java.lang.String sequence)
          Create an object to be used to send a message to a Lightstreamer Server.
MessageInfo(java.lang.String message, java.lang.String sequence, int delayTimeout)
          Create an object to be used to send a message to a Lightstreamer Server.
 
Method Summary
 int getDelayTimeout()
          Recalls the delay timeout specified for this message.
 java.lang.String getMessage()
          Recalls the message to be sent to the server.
 java.lang.String getSequence()
          Recalls sequence name specified for this message.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNORDERED_MESSAGES

public static final java.lang.String UNORDERED_MESSAGES
Constant representing the special sequence name to be used to prevent the sequential management of the messages on the server.

See Also:
Constant Field Values
Constructor Detail

MessageInfo

public MessageInfo(java.lang.String message,
                   java.lang.String sequence)
Create an object to be used to send a message to a Lightstreamer Server. The object can be supplied to LSClient.sendMessage(MessageInfo,SendMessageListener) in order to be forwarded to the server.

Parameters:
message - A text String to be interpreted by the Metadata Adapter. It should not be null
sequence - The sequence identifier for this Message. Messages pertaining to the same sequence are guaranteed to be processed by the server in order. The position of the message in the sequence is given by the LSClient.sendMessage() method. If sequential management is undesired, the special UNORDERED_MESSAGES sequence identifier can be used. A sequence can be composed only of alphanumeric characters and underscores. Note that the Server in case of a hole in the sequence's progressive, before declaring the previous message as lost, will use a timeout based on its own configuration.
Throws:
java.lang.IllegalArgumentException - Thrown if a null message is specified or if the given sequence name is invalid.

MessageInfo

public MessageInfo(java.lang.String message,
                   java.lang.String sequence,
                   int delayTimeout)
Create an object to be used to send a message to a Lightstreamer Server. The object can be supplied to LSClient.sendMessage(MessageInfo,SendMessageListener) in order to be forwarded to the server.

Parameters:
message - A text String to be interpreted by the Metadata Adapter. It should not be null
sequence - The sequence identifier for this Message. Messages pertaining to the same sequence are guaranteed to be processed by the server in order. The position of the message in the sequence is given by the LSClient.sendMessage() method. If sequential management is undesired, the special UNORDERED_MESSAGES sequence identifier can be used. A sequence can be composed only of alphanumeric characters and underscores.
delayTimeout - The timeout the Server should wait in case of a hole in the sequence's progressive before declaring the previous message as lost.
The Server may, however, impose a lower limit on the timeout, in order to protect itself.
A 0 timeout can be set meaning that the Server will not wait at all for missing messages.
When UNORDERED_MESSAGES sequence is used this timeout is ignored by the server.
If a negative value is supplied, the Server will use a timeout based on its own configuration.
Throws:
java.lang.IllegalArgumentException - Thrown if a null message is specified or if the given sequence name is invalid.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDelayTimeout

public int getDelayTimeout()
Recalls the delay timeout specified for this message.

Returns:
the delay timeout.

getSequence

public java.lang.String getSequence()
Recalls sequence name specified for this message.

Returns:
the sequence name.

getMessage

public java.lang.String getMessage()
Recalls the message to be sent to the server.

Returns:
the message.