Package io.mats3.matssocket
Enum Class MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState
java.lang.Object
java.lang.Enum<MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState>
io.mats3.matssocket.MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState
- All Implemented Interfaces:
Serializable
,Comparable<MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState>
,Constable
- Enclosing interface:
- MatsSocketServer.ActiveMatsSocketSession
public static enum MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState
extends Enum<MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState>
The state of ActiveMatsSocketSession.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThisMatsSocketServer.ActiveMatsSocketSession
instance is dead - and the MatsSocketSession that thisMatsSocketServer.ActiveMatsSocketSession
represented was CLOSED - i.e.ThisMatsSocketServer.ActiveMatsSocketSession
instance is dead - but the MatsSocketSession that thisMatsSocketServer.ActiveMatsSocketSession
represented is still "live" in thedata store
, i.e.HELLO not yet processed - only accepts messages up to HELLO.HELLO is processed and auth verified, and we are processing all kinds of messages. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_SESSION
HELLO not yet processed - only accepts messages up to HELLO. This is the initial state of a MatsSocketSession, but you will probably never see an instance in this state, as the session is not registered with the MatsSocketServer until HELLO is processed, and thus the session isSESSION_ESTABLISHED
-
SESSION_ESTABLISHED
public static final MatsSocketServer.ActiveMatsSocketSession.MatsSocketSessionState SESSION_ESTABLISHEDHELLO is processed and auth verified, and we are processing all kinds of messages. Note: All fields shall be set in this state, i.e. auth string, principal, userId, websocket etc. -
DEREGISTERED
ThisMatsSocketServer.ActiveMatsSocketSession
instance is dead - but the MatsSocketSession that thisMatsSocketServer.ActiveMatsSocketSession
represented is still "live" in thedata store
, i.e. it was just DEREGISTERED, and can be "resurrected" by starting a new MatsSocketSession and include the existing MatsSocketSessionId in the HELLO message. Do understand that it will not be the same instance ofActiveMatsSocketSession
that is "reanimated" - a new instance will be created if the client reconnects. Note: Several "active fields" are nulled out when in this state. -
CLOSED
ThisMatsSocketServer.ActiveMatsSocketSession
instance is dead - and the MatsSocketSession that thisMatsSocketServer.ActiveMatsSocketSession
represented was CLOSED - i.e. the MatsSocketSession is gone forever, any outstanding replies are dead etc, and the MatsSocketSession cannot be "resurrected". Note: Several "active fields" are nulled out when in this state.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isHandlesMessages
public boolean isHandlesMessages()- Returns:
- whether in this state the MatsSocketSession handles incoming and outgoing messages - i.e. whether
the WebSocket message handler should process incoming messages, or the outgoing handler should
send outgoing messages (
SESSION_ESTABLISHED
andNO_SESSION
, for the latter only accepts HELLO), or reject them outright (DEREGISTERED
andCLOSED
).
-