Class Connection
Object
|
+--Connection
- class
Connection
Bean object that contains the configuration settings needed
to connect to Lightstreamer Server.
The class constructor, its prototype and any other properties should never
be used directly; actually, Connection is not even defined as a global name.
Defined in lscommons.js
See:
Constructor Summary |
Connection
()
Used by Lightstreamer to provide a connection properties bean object
to the LightstreamerEngine object.
|
Method Summary |
String
|
getAdapterName()
Inquiry method that gets the name of the Adapter Set (which defines
the Metadata Adapter and one or several Data Adapters) mounted on
Lightstreamer Server that supply all the items used in this application.
|
String
|
getLSHost()
Inquiry method that gets the address of Lightstreamer Server.
|
Number
|
getLSPort()
Inquiry method that gets the TCP port to be used for the connections
to Lightstreamer Server.
|
String
|
getServerUrlPath()
Inquiry method that gets the base URL path currently prepended to all
request URLs for Lightstreamer Server.
|
String
|
getStatusBarUrlPortion()
Inquiry method that gets the string to be used as the final part of the
streaming page URL on the next requests.
|
void
|
setAdapterName(<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
|
setLSHost(<String> hostAddress)
Setter method that sets the address of Lightstreamer Server.
|
void
|
setLSPort(<Number> port)
Setter method that sets the TCP port to be used for all the connections
to Lightstreamer Server.
|
void
|
setPassword(<String> password)
Setter method that sets the password to be used for the authentication
on Lightstreamer Server when initiating the push session.
|
void
|
setServerUrlPath(<String> urlPath)
Setter method that sets the base URL path to be prepended to all request
URLs for Lightstreamer Server.
|
void
|
setStatusBarUrlPortion(<String> newPortion)
Setter method that sets the final part of the streaming page URL.
|
void
|
setUserName(<String> user)
Setter method that sets the username to be used for the authentication
on Lightstreamer Server when initiating the push session.
|
Connection
Connection()
Used by Lightstreamer to provide a connection properties bean object
to the LightstreamerEngine object.
getAdapterName
String getAdapterName()
Inquiry method that gets the name of the Adapter Set (which defines
the Metadata Adapter and one or several Data Adapters) mounted on
Lightstreamer Server that supply all the items used in this application.
Returns:
the name of the Adapter Set; returns null if no name has been configured, so that the "DEFAULT" Adapter Set is used.
getLSHost
String getLSHost()
Inquiry method that gets the address of Lightstreamer Server.
Returns:
The address of Lightstreamer Server.
getLSPort
Number getLSPort()
Inquiry method that gets the TCP port to be used for the connections
to Lightstreamer Server.
Returns:
the TCP port to be used for the connections to Lightstreamer Server.
getServerUrlPath
String getServerUrlPath()
Inquiry method that gets the base URL path currently prepended to all
request URLs for Lightstreamer Server.
Returns:
The base URL path; it always starts with a '/' character.
getStatusBarUrlPortion
String getStatusBarUrlPortion()
Inquiry method that gets the string to be used as the final part of the
streaming page URL on the next requests.
Returns:
a string, which represents the final part of the streaming page URL.
setAdapterName
void setAdapterName(<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.
Default value: The default Adapter Set, configured as
"DEFAULT" on the Server.
Lifecycle: The Adapter Set name should be set on the
LightstreamerEngine.connection object before changing the
status to "STREAMING" or "POLLING". However, the value can be changed
at any time, provided that the Engine status is "DISCONNECTED"; the
supplied value will be used for the next connection attempt.
Parameters:
adapterName
- The name of the Adapter Set te be used.
setLSHost
void setLSHost(<String> hostAddress)
Setter method that sets the address of Lightstreamer Server.
Setting Lightstreamer Server address is not required when the front-end
pages are supplied by Lightstreamer Server itself (although this
scenario is advised only for demo purpose).
On the other hand, the setting is mandatory if the front-end pages are
served by an external Web server. In this case, calling the
setLSPort() method may also be needed, because its default value
is the port used for loading the library pages from the Web
server, which may be different than the port used by Lightstreamer Server.
The protocol used to connect to Lightstreamer Server is always the same
used to download the Master Push-Page. So if the Master Push-Page is
downloaded through HTTP, then HTTP will be used for all the connections
to Lightstreamer Server. It the Master Push-Page is downloaded through
HTTPS, all the connections to Lightstreamer Server will use HTTPS.
Edition Note: HTTPS connections are not
supported by the Server if it runs in Allegro edition.
Edition Note: HTTPS connections are not
supported by the Server if it runs in Moderato edition.
Default value: location.hostname (the hostname of the server
that supplies the library pages).
Lifecycle: The Server address should be set on the
LightstreamerEngine.connection object before changing the
status to "STREAMING" or "POLLING". However, the value can be changed
at any time, provided that the Engine status is "DISCONNECTED"; the
supplied value will be used for the next connection attempt.
Parameters:
hostAddress
- The full address of Lightstreamer Server (e.g. "push.mycompany.com"). A null value can also be used, to restore the default value, determined as location.hostname.
setLSPort
void setLSPort(<Number> port)
Setter method that sets the TCP port to be used for all the connections
to Lightstreamer Server.
Default value: location.port (the port used for the
library pages loading).
Lifecycle: The port should be set on the
LightstreamerEngine.connection object before changing the
status to "STREAMING" or "POLLING". However, the value can be changed
at any time, provided that the Engine status is "DISCONNECTED"; the
supplied value will be used for the next connection attempt.
Parameters:
port
- The TCP port to be used for the connections. A null value can also be used, to restore the default value, determined as location.port.
setPassword
void setPassword(<String> password)
Setter method that sets the password to be used for the authentication
on Lightstreamer Server when initiating the push session.
The Metadata Adapter is responsible for checking the credentials
(username and password).
Default value: If no password is supplied, no password
information will be sent at session initiation. The Metadata Adapter,
however, may still allow the session.
Lifecycle: The password should be set on the
LightstreamerEngine.connection object before changing the
status to "STREAMING" or "POLLING". However, the value can be changed
at any time, provided that the Engine status is "DISCONNECTED"; the
supplied value will be used for the next connection attempt.
NOTE: The password string will be stored as a JavaScript
variable.
That is necessary in order to allow automatic reconnection/reauthentication
for fail-over. For maximum security, avoid using an actual private
password to authenticate on Lightstreamer Server; rather use
a session-id originated by your web/application server, that can be
checked by your Metadata Adapter.
Parameters:
password
- The password to be used for the authentication on Lightstreamer Server. The password can be null.
setServerUrlPath
void setServerUrlPath(<String> urlPath)
Setter method that sets the base URL path to be prepended to all request
URLs for Lightstreamer Server. As some request URLs may be displayed
on the screen by the browser, customizing the first part of the URL
could be desirable.
Note that, in order to use a non-default base URL path, the same path
must be configured on the Server, through the <base_url_path> element.
The URL path should start with a '/' character.
Default value: "/lightstreamer".
Lifecycle: The base URL path can be changed at any time.
Parameters:
urlPath
- a legal URL path, starting with a '/' character. A null value can also be used, to restore the default "/lightstreamer" URL path.
setStatusBarUrlPortion
void setStatusBarUrlPortion(<String> newPortion)
Setter method that sets the final part of the streaming page URL.
The full URL path used for streaming page requests will be
/lightstreamer/_<newPortion> where <newPortion> represents the supplied
string. As the streaming URL path is often made visible by the browsers
while the streaming page is being loaded, this setting allows for
some control of the application appearance.
This holds, in particular, with Internet Explorer 7 and 8, which show
the streaming page URL in the top window status bar. The same holds
with Internet Explorer 6; in this case, however, as long as no custom
handler for the LightstreamerEngine.onStatusChange() event is
set, the default handler takes care of overwriting the status bar with
a simple message.
Default value: If no value is supplied, the
"STREAMING_IN_PROGRESS" string is used.
Lifecycle: The final part of the streaming page URL should
be set on the LightstreamerEngine.connection object before
changing the status to "STREAMING". However, the value can be changed
at any time; the supplied value will be used upon the next connection
attempt.
Parameters:
newPortion
- Any string, to be used as the final part of the streaming page URL. The supplied value will be escaped, if needed. An empty string is also allowed.
setUserName
void setUserName(<String> user)
Setter method that sets the username to be used for the authentication
on Lightstreamer Server when initiating the push session.
The Metadata Adapter is responsible for checking the credentials
(username and password).
Default value: If no username is supplied, no user
information will be sent at session initiation. The Metadata Adapter,
however, may still allow the session.
Lifecycle: The username should be set on the
LightstreamerEngine.connection object before changing the
status to "STREAMING" or "POLLING". However, the value can be changed
at any time, provided that the Engine status is "DISCONNECTED"; the
supplied value will be used for the next connection attempt.
Parameters:
user
- The username to be used for the authentication on Lightstreamer Server. The username can be null.
Lightstreamer HTML Client API
Documentation generated by
JSDoc on Tue May 22 11:46:54 2012