Enum Class MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType
- All Implemented Interfaces:
- Enclosing interface:
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
RECONNECTmultiple times, but will always eventually get a
Nested Class Summary
Enum Constant Summary
Method SummaryModifier and TypeMethodDescription
booleanReturns 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.
Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Enum Constant Details
DEREGISTERpublic static final MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType DEREGISTERThe 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 NOT
closed- the session will either
SessionEstablishedEventType.RECONNECTagain, or you will get a
TIMEOUTat a later point.
CLOSEpublic static final MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType CLOSEThe 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 now
TIMEOUTpublic static final MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType TIMEOUT
valuespublic static MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType values()Returns an array containing the constants of this enum class, in the order they are declared.
- an array containing the constants of this enum class, in the order they are declared
valueOfpublic static MatsSocketServer.SessionRemovedEvent.SessionRemovedEventType valueOf
(String name)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.)
isSessionClosedpublic boolean isSessionClosed()