Hi Martin,

There exist cases where you could decide to disconnect a user from Lightstreamer Server (for example if they log into a second session on a different Server and you don't want to support multiple push session for the same account; if you have one Server only, ConflictingSessionException will do the trick). There are three ways to terminate an existing Lightstreamer session (one of which has been deprecated):

Option 1) Implement the getUserSession() method of the MetadataProvider together with the KILL command on the HTTP interface (see section 4.4 of “Network Protocol Tutorial.pdf”). But the getUserSession() method has been deprecated (i.e. we could decide in future releases of Lightstreamer Server to discontinue it), mainly for security reasons.

Option 2) Use JMX (which is only available in the Vivace Edition of Lightstreamer). JMX (Java Management eXtensions) is a standard specification that allows an application to be controlled both internally and externally and both manually and automatically (i.e. from code). Lightstreamer Server exposes a set of MBeans that give full control over the engine and the sessions. To terminate a session through JMX, you just need to call the destroySession() method on the appropriate SessionMBean object. The powerful aspect is that you can access MBean objects both from inside your Adapter and from your J2EE application server, because JMX already implements several transport protocols for remote invocation, besides in-process invocation.

Option 3) Handle the termination on the client side. Your clients will subscribe to some "service item" through which your Data Adapter will deliver termination notifications to the clients. When a client receives such message, it will terminate its Lightstreamer session, disconnecting from Lightstreamer Server.