com.lightstreamer.javameclient.midp
Class ConnectionInfo

java.lang.Object
  extended by com.lightstreamer.javameclient.midp.ConnectionInfo

public class ConnectionInfo
extends java.lang.Object

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


Constructor Summary
ConnectionInfo(java.lang.String server)
          Creates a connection settings bean object with default settings specified.
 
Method Summary
 void setAdapter(java.lang.String adapterName)
          Setter method that sets the name of the Adapter Set mounted on Lightstreamer Server to be used to handle all requests in the session.
 void setContentLength(int contentLength)
          Setter method that sets the Content-Length for the stream connection (a minimum length, however, is ensured by the Server).
 void setControlInHttps(boolean https)
          Setter method that sets the protocol to be used for the control connections to Lightstreamer Server.
 void setControlPort(int controlPort)
          Setter method that sets the TCP port to be used for the control connections to Lightstreamer Server.
 void setPassword(java.lang.String password)
          Setter method that sets the password to be used for the authentication on Lightstreamer Server at connection start.
 void setPort(int port)
          Setter method that sets the TCP port to be used for the stream/poll connections to Lightstreamer Server.
 void setServer(java.lang.String server)
          Setter method that sets the address of Lightstreamer Server.
 void setUser(java.lang.String user)
          Setter method that sets the username to be used for the authentication on Lightstreamer Server at connection start.
 void setWorkInHttps(boolean https)
          Setter method that sets the protocol to be used for the stream/poll connections to Lightstreamer Server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionInfo

public ConnectionInfo(java.lang.String server)
Creates a connection settings bean object with default settings specified.

Parameters:
server - The full address of Lightstreamer Server (e.g. "push.mycompany.com").
Method Detail

setServer

public void setServer(java.lang.String server)
Setter method that sets the address of Lightstreamer Server.

Parameters:
server - The full address of Lightstreamer Server (e.g. "push.mycompany.com").

setAdapter

public void setAdapter(java.lang.String adapterName)
Setter method that sets the name of the Adapter Set mounted on Lightstreamer Server 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.

Parameters:
adapterName - The name of the Adapter Set te be used.
See Also:
SimpleTableInfo.setDataAdapter(java.lang.String)

setUser

public void setUser(java.lang.String user)
Setter method that sets the username to be used for the authentication on Lightstreamer Server at connection start. The Metadata Adapter is responsible for credentials check.

Parameters:
user - The username to be used for the authentication on Lightstreamer Server.

setPassword

public void setPassword(java.lang.String password)
Setter method that sets the password to be used for the authentication on Lightstreamer Server at connection start. The Metadata Adapter is responsible for credentials check.

Parameters:
password - The password to be used for the authentication on Lightstreamer Server.

setPort

public void setPort(int port)
Setter method that sets the TCP port to be used for the stream/poll connections to Lightstreamer Server. Note that due to security restrictions, untrusted Midlets can't connect to ports 80, 443 and 8080 through direct TCP sockets. Since the MIDP 2.0 version of the Lightstreamer Client Library employs direct TCP sockets, you will not be able to connect to a Lightstreamer Server listening on such ports if the Midlet is untrusted.

Parameters:
port - The TCP port to be used for the stream/poll connections (default is 8080).

setWorkInHttps

public void setWorkInHttps(boolean https)
Setter method that sets the protocol to be used for the stream/poll connections to Lightstreamer Server.

Note that HTTPS is not part of MIDP1.0 specs and depends entirely by mobile implementations.

Parameters:
https - True to use HTTPS for stream/poll connections, false otherwise (default is false).

setControlPort

public void setControlPort(int controlPort)
Setter method that sets the TCP port to be used for the control connections to Lightstreamer Server. Control connections are used to request item subscriptions or unsubscriptions to the Server and to change streaming constraints for an active stream connection. Using LSClient in single connection mode this set is useless.

Parameters:
controlPort - The TCP port to be used for the control connections (default is the value of setPort(int)).

setControlInHttps

public void setControlInHttps(boolean https)
Setter method that sets the protocol to be used for the control connections to Lightstreamer Server. Control connections are used to request item subscriptions or unsubscriptions to the Server and to change streaming constraints for an active stream connection. They are usually issued in the same protocol used for stream/poll connections, but using HTTP for control and HTTPS for streaming connections is also meaningful. Using LSClient in single connection mode this set is useless.

Note that HTTPS is not part of MIDP1.0 specs and depends entirely by mobile implementations.

Parameters:
https - True to use HTTPS for control connections, false otherwise (default is the value of setWorkInHttps(boolean)).

setContentLength

public void setContentLength(int contentLength)
Setter method that sets the Content-Length for the 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 0 is specified, the Content-Length will be decided by the Server.

Parameters:
contentLength - The content length in byte. Default value is 1000000.