Java API: how to determine if session is closed

OpenVidu may close a session by itself. For example, no more users, no more users and recording for more than two minutes.

Is there a method in Java API’s Session which determine if a session has been closed? Similarly, how to known if a particular Connection instance represents a closed connection?

I think using cdr api you can all detail about any session.
Thanks
Vipin