Package io.mats3.matssocket
Enum Class MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType
java.lang.Object
java.lang.Enum<MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType>
io.mats3.matssocket.MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType
- All Implemented Interfaces:
Serializable
,Comparable<MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType>
,Constable
- Enclosing interface:
- MatsSocketServer.SessionRemovedEvent
public static enum MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType
extends Enum<MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType>
Type of "remove": Either DEREGISTER, CLOSE or TIMEOUT. You may get one or several invocations for a session:
You may get a CLOSE by itself: The user has logged in, does some stuff, and then "logs out" / closes the
browser tab (i.e. invoking
client.close()
), thus actively closing the session explicitly. Or,
you may first get a DEREGISTER e.g. due to the Client driving through a tunnel and loosing connection, in
which case the most likely result is (hopefully) that the Client again
SessionEstablishedEventType.RECONNECT
- but if not, the Server
may shortly get a CLOSE - or much later a TIMEOUT. This means that the session may alter back and forth
between DEREGISTER
and RECONNECT
multiple times, but
will always eventually get a CLOSE
or TIMEOUT
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe MatsSocketSession was explicitly closed.The WebSocket connection was severed without an explicit MatsSocketSession closing, e.g.The MatsSocketSession was previouslyDEREGISTER
, but was now "cleaned out" by the timeouter. -
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
-
DEREGISTER
The WebSocket connection was severed without an explicit MatsSocketSession closing, e.g. because the user driving through a Tunnel or closing the lid of his laptop, or similar things that break the WebSocket connection. The MatsSocketSession is now still NOTclosed
- the session will eitherSessionEstablishedEventType.RECONNECT
again, or you will get aCLOSE
orTIMEOUT
at a later point. -
CLOSE
The MatsSocketSession was explicitly closed. This may, or may not, have implied that the WebSocket connection was closed (either it was open, and was closed with this event - or it was already closed (DEREGISTER)). The MatsSocketSession is nowclosed
. -
TIMEOUT
The MatsSocketSession was previouslyDEREGISTER
, but was now "cleaned out" by the timeouter. The MatsSocketSession is nowclosed
.
-
-
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
-
isSessionClosed
public boolean isSessionClosed()- Returns:
- whether this event type represents a closing of the session (i.e. removing all traces of it -
type
CLOSE
orTIMEOUT
), or if it can stillRECONNECT
with the same MatsSocketSessionId (typeDEREGISTER
).
-