com.lightstreamer.ls_client
Class ConnectionInfo

java.lang.Object
  extended by com.lightstreamer.ls_client.ConnectionInfo
All Implemented Interfaces:
java.lang.Cloneable

public class ConnectionInfo
extends java.lang.Object
implements java.lang.Cloneable

Collects the parameters related to a connection request to Lightstreamer Server.


Field Summary
 java.lang.String adapter
          ID of the Adapter Set to be used to handle all requests in the session.
 ConnectionConstraints constraints
          Configuration object that specifies the constraints to be applied on the overall data flow from the Connection.
 long contentLength
          The length to be used by the Server for the response body on a stream connection (a minimum length, however, is ensured by the server).
 boolean enableControlLinkHandling
          If true, enables the automatic handling of the server address in order to bypass the load balancer server (if any) after the first connection and allow the cleanest communication possible between Lightstreamer client and server.
 boolean enableStreamSense
          If true, enables the Stream-sense feature; in case a streaming session is being opened (i.e.
 boolean isPolling
          If set to true, data streaming is simulated through a smart polling mechanism, that is a sequence of synchronous connections to the Server, each of which will receive the currently available updates, or wait until one is available.
 long keepaliveMillis
          Keepalive time requested for the stream connection.
 java.lang.String password
          User password to be supplied to the Server in the connection request.
 long pollingIdleMillis
          Maximum time the Server is allowed to wait for updates in case none are available at connection time and a poll connection has been requested.
 long pollingMillis
          Time between the end of a poll connection and the start of the next one, if polling behaviour has been specified.
 long probeTimeoutMillis
          Timeout for activity checks, expressed in milliseconds.
 long probeWarningMillis
          Timeout for activity check warnings, expressed in milliseconds.
 java.lang.String pushServerControlUrl
          Lightstreamer Server URL (without the path part) to be used for control requests; e.g.
 java.lang.String pushServerUrl
          Lightstreamer Server URL, without the path part; e.g.
 long reconnectionTimeoutMillis
          The maximum elapsed time in milliseconds allowed for a successful reconnection attempt.
 long streamingTimeoutMillis
          The maximum elapsed time in milliseconds allowed for the first successful streaming connection attempt on a streaming session.
 java.lang.String user
          User name to be supplied to the Server in the connection request.
 
Constructor Summary
ConnectionInfo()
          Creates a connection settings bean object with default settings specified.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object other)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

probeTimeoutMillis

public long probeTimeoutMillis
Timeout for activity checks, expressed in milliseconds. If, after a warning that the connection is stalled (see probeWarningMillis), no data has been received on the stream connection for this further time, then the connection is forcibly closed.
The default setting is 3000 (3 seconds).


probeWarningMillis

public long probeWarningMillis
Timeout for activity check warnings, expressed in milliseconds. If no data is being received on the stream connection and a keepalive message is late for this time, then a notification is issued to the ConnectionListener that the connection is stalled.
After the notification, if some data or keepalive is received before probeTimeoutMillis elapses, then a notification is issued to the ConnectionListener that the activity is normal again; otherwise the connection is forcibly closed.
The default setting is 2000 (2 seconds).

See Also:
ConnectionListener.onActivityWarning(boolean)

keepaliveMillis

public long keepaliveMillis
Keepalive time requested for the stream connection. After an inactivity of this length on the stream connection, a keepalive signal is sent by the Server. If it is 0, the keepalive time is decided by the Server. If it is too small, the Server may use a different keepalive time as well.
The default setting is 0.


reconnectionTimeoutMillis

public long reconnectionTimeoutMillis
The maximum elapsed time in milliseconds allowed for a successful reconnection attempt. Silent reconnections are performed in case of response content length filling or if polling behaviour has been requested. NOTE: The first connection is not checked against this timeout; this can be done by the user by observing the elapsed time in the LSClient.openConnection(com.lightstreamer.ls_client.ConnectionInfo, com.lightstreamer.ls_client.ConnectionListener) call.
The default setting is 5000 (5 seconds).


enableStreamSense

public boolean enableStreamSense
If true, enables the Stream-sense feature; in case a streaming session is being opened (i.e. isPolling is false) and no answer has been received on the newly opened connection after a few seconds (set through streamingTimeoutMillis), the connection attempt is discarded and a new session opening attempt is performed in smart polling mode.
The default setting is true.


enableControlLinkHandling

public boolean enableControlLinkHandling
If true, enables the automatic handling of the server address in order to bypass the load balancer server (if any) after the first connection and allow the cleanest communication possible between Lightstreamer client and server.
The default setting is true.


streamingTimeoutMillis

public long streamingTimeoutMillis
The maximum elapsed time in milliseconds allowed for the first successful streaming connection attempt on a streaming session. The timeout check is performed only when the Stream-sense feature is enabled, i.e. enableStreamSense is true; if it fails, the current attempt will be discarded and a new session opening will be tried in smart polling mode.
NOTE: In case the connection is not possible at all, the polling attempt may also hang. However, no timeout check on the polling attempt is performed; this can be done by the user, by observing the elapsed time in the LSClient.openConnection(com.lightstreamer.ls_client.ConnectionInfo, com.lightstreamer.ls_client.ConnectionListener) call. That custom timeout should be significantly greater than streamingTimeoutMillis; if it fires too early and a connection close is forced, then the Stream-sense mechanism might operate in vain.
The default setting is 5000 (5 seconds).


contentLength

public long contentLength
The length to be used by the Server for the response body on a stream connection (a minimum length, however, is ensured by the server). After the content length exhaustion, the connection will be closed and a new connection will be automatically reopened. If it is 0, the length is decided by the Server.
The default setting is set to a very high value (50 millions).


pushServerUrl

public java.lang.String pushServerUrl
Lightstreamer Server URL, without the path part; e.g. "https://push.lightstreamer.com". Setting this property is mandatory.


pushServerControlUrl

public java.lang.String pushServerControlUrl
Lightstreamer Server URL (without the path part) to be used for control requests; e.g. "http://push.lightstreamer.com:80". Typically, it may differ from pushServerUrl because of the protocol. If it is null, then pushServerUrl is used.
The default setting is null.


user

public java.lang.String user
User name to be supplied to the Server in the connection request. If it is null, no User name is supplied.
The default setting is null.


password

public java.lang.String password
User password to be supplied to the Server in the connection request. If it is null, no User password is supplied.
The default setting is null.


adapter

public java.lang.String adapter
ID of the Adapter Set to be used to handle all requests in the session.
An Adapter Set defines the Metadata Adapter and one or several Data Adapters. It is configured on the server side through an "adapters.xml" file; the ID is configured through the "id" attribute in the "adapters_conf" element.
The default setting is null, which is equivalent to the "DEFAULT" ID.

See Also:
SimpleTableInfo.setDataAdapter(java.lang.String)

isPolling

public boolean isPolling
If set to true, data streaming is simulated through a smart polling mechanism, that is a sequence of synchronous connections to the Server, each of which will receive the currently available updates, or wait until one is available.
The use of polling can become necessary in cases where the connection stream is not delivered in real time because of some router or firewall or antivirus. Even when this flag is set to false, however, the library may detect those cases and automatically attempt to resort to a smart polling connection, provided that enableStreamSense is set to true.
The default setting is false.


pollingMillis

public long pollingMillis
Time between the end of a poll connection and the start of the next one, if polling behaviour has been specified. Zero is a legal value, although the Server may decide to delay request fulfilling if request frequency is too high. Note: since the Server needs to keep a session active between subsequent poll connections, the Server may force the library to use a polling time shorter than requested.
The default setting is 0.


pollingIdleMillis

public long pollingIdleMillis
Maximum time the Server is allowed to wait for updates in case none are available at connection time and a poll connection has been requested. A zero value leads to a classical polling behaviour, while a nonzero value leads to an "asynchronous polling", also known as smart polling, behaviour. Typically, a nonzero value for this attribute is associated with a zero value for the "pollingMillis" attribute. Note: since the Server, while waiting for an update, needs to keep a socket and a session active, even if the client has already closed the connection on its side, the Server may force a shorter wait.
The default setting is 30000 (30 seconds).


constraints

public ConnectionConstraints constraints
Configuration object that specifies the constraints to be applied on the overall data flow from the Connection. The specified constraints can only be used in order to restrict the constraints set by Lightstreamer Server Metadata Adapter. It cannot be null.
The default setting is a constraints configuration object with no constraints specified.

Constructor Detail

ConnectionInfo

public ConnectionInfo()
Creates a connection settings bean object with default settings specified.

Method Detail

toString

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object