public static interface MatsSocketServer.LiveMatsSocketSession extends MatsSocketServer.ActiveMatsSocketSession
getState(), but when you read MatsSocketServer.ActiveMatsSocketSession.getAuthorization(), it could return Optional.empty() -
because the user concurrently closed the session (and if reading getState() again, it would now return CLOSED).MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState| Modifier and Type | Method and Description |
|---|---|
java.util.EnumSet<AuthenticationPlugin.DebugOption> |
getAllowedDebugOptions() |
java.util.Optional<java.security.Principal> |
getPrincipal() |
MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState |
getState() |
javax.websocket.Session |
getWebSocketSession() |
MatsSocketServer.ActiveMatsSocketSessionDto |
toActiveMatsSocketSession() |
getAuthorization, getLastActivityTimestamp, getLastAuthenticatedTimestamp, getLastClientPingTimestamp, getLastEnvelopes, getOriginatingRemoteAddr, getPrincipalName, getRemoteAddr, getSessionEstablishedTimestamp, getTopicSubscriptionsgetAppName, getAppVersion, getClientLibAndVersions, getMatsSocketSessionId, getNodeName, getSessionCreatedTimestamp, getSessionLivelinessTimestamp, getUserIdMatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState getState()
ActiveMatsSocketSession. You should really
only ever see SESSION_ESTABLISHED, but due to the
concurrency wrt. you getting hold of an LiveMatsSocketSession instance, and the Client performing a
DEREGISTER or CLOSE,
you may also observe DEREGISTERED and
CLOSED.javax.websocket.Session getWebSocketSession()
java.util.Optional<java.security.Principal> getPrincipal()
MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState.SESSION_ESTABLISHED.java.util.EnumSet<AuthenticationPlugin.DebugOption> getAllowedDebugOptions()
AuthenticationPlugin.DebugOption the the active AuthenticationPlugin allows the
current Principal to request.MatsSocketServer.ActiveMatsSocketSessionDto toActiveMatsSocketSession()
MatsSocketServer.ActiveMatsSocketSessionDto. Do
observe that due to the concurrency of these live sessions, you may get a copy of when the session
had become (state) DEREGISTERED or
CLOSED, and where some of the Optional-returning methods then
returns Optional.empty(). If you do not want to handle such instances, then you might want to check
getState() after invoking this method, and if not
SESSION_ESTABLISHED, then ditch the instance that
you just copied out - this is what MatsSocketServer.getActiveMatsSocketSessions() does.