I suppose you use library version 2.5.x, because the revised "unified" version 3.0 (available as a final release
here, on maven - look for com/lightstreamer/ls-javase-client) does offer a
getSessionId method.
For the old library, we suggest you leveraging the library's own log.
This log leans on the JDK's java.util.logging service, that you can configure as shown in the conf/logCfg.properties file provided within the SDK.
Setting "com.lightstreamer.ls_client.session.level" at FINE should be the simplest way to have the session ID logged.
I confirm that we have plans for releasing the source code of the client libraries; we just need time to organize the operation.
But this, again, will not involve Java Library version 2.5.x, but only the "unified" version.