Lightstreamer .Net Adapter 1.7
ContentsIndexHome
PreviousUpNext
IMetadataProvider.NotifyNewSession Method

Called by Lightstreamer Kernel through the Remote Server to check that a User is enabled to open a new push Session. If the check succeeds, this also notifies the Metadata Adapter that the Session is being assigned to the User. 

Request context information is also available; this allows for differentiating group, schema and message management based on specific Request characteristics. 

This method runs in the Server thread pool specific for the Adapter Set, if defined. 

 

C++
void NotifyNewSession(string user, string sessionID, IDictionary clientContext);
C#
void NotifyNewSession(string user, string sessionID, IDictionary clientContext);
Visual Basic
Function NotifyNewSession(user As string, sessionID As string, clientContext As IDictionary) As void
Parameters 
Description 
string user 
A User name. 
string sessionID 
The ID of a new Session. 
IDictionary clientContext 
An IDictionary-type value object that contains name-value pairs with various information about the request context. All values are supplied as strings. Information related to a client connection refers to the HTTP request that originated the call. Available keys are:
- "REMOTE_IP" - string representation of the remote IP related to the current connection; it may be a proxy address
- "REMOTE_PORT" - string representation of the remote port related to the current connection
- "USER_AGENT" - the user-agent as declared in the current connection HTTP header
- "FORWARDING_INFO" - the content of the X-Forwarded-For HTTP header related to the current connection; intermediate proxies usually set this header to supply connection routing information
- "LOCAL_SERVER" - the name of the specific server socket that handles the current connection, as configured through the <http_server> or <https_server> element
- "REQUEST_ID" - the same id that has just been supplied to NotifyUser for the current client request instance; this allows for using local authentication-related details for the authorization task. 

the Remote Adapter is responsible for disposing any cached information in case NotifyNewSession is not called because of any early error during request management. 

 

Exceptions 
Description 
in case the User is not enabled to open the new Session. If it's possible that the User would be enabled as soon as another Session were closed, then a ConflictingSessionException can be thrown, in which the ID of the other Session must be specified. In this case, a second invocation of the method with the same “REQUEST_ID” and a different Session ID will be received.  
in case something is wrong in the parameters, such as the ID of a Session already open for this or a different User.