Notifies this listener that the specified client session has logged in, and returns a {@link ClientSessionListener} for thatsession. The returned listener should implement {@link Serializable} so that it can be stored persistently. If thereturned listener does not implement {@code Serializable}, then the client session is disconnected without completing the login process.
The returned {@code ClientSessionListener} is notified asfollows:
- If a message is received from the specified client session, the returned listener's {@link ClientSessionListener#receivedMessage receivedMessage} methodis invoked with the message.
- If the specified client session logs out or becomes disconnected for other reasons, the returned listener's {@link ClientSessionListener#disconnected disconnected} method isinvoked with a {@code boolean} that is {@code true}if the client logged out gracefully, and is {@code false}otherwise.
The {@code session} passed to this method is persisted inthe data manager. The application may remove the {@code session} from the data manager in order to disconnect thesession. If the application does not remove the specified client session, the client session is removed when the {@link ClientSessionListener#disconnected disconnected} method invokedon the returned listener completes.
A return value of {@code null} has special meaning,indicating that the specified client session should not complete the login process and should be disconnected immediately.
@param session a client session
@return a (serializable) listener for the client session,or {@code null} to indicate that the session shouldbe terminated without completing the login process.