Package io.mats3.matssocket
Enum Class MatsSocketServer.MessageType
- All Implemented Interfaces:
Serializable
,Comparable<MatsSocketServer.MessageType>
,Constable
- Enclosing interface:
- MatsSocketServer
All Message Types (aka MatsSocket Envelope Types) used in the wire-protocol of MatsSocket.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe specified message was Received, and acknowledged positively - i.e.An "Acknowledge ^ 2", i.e.From Client: The client can use a separate AUTH message to send over the requestedREAUTH
(it could just as well put the 'auth' in a PING or any other message it had pending).A HELLO message must be part of the first Pipeline of messages, preferably alone.The specified message was Received, but it did not acknowledge it - i.e.A PING, to which aPONG
is expected.A Reply to aPING
.Topic message from Server: A message is issued on Topic, the TopicId is specified in 'eid', while the message is in 'msg'.The server requests that the Client re-authenticates, where the Client should immediately get a fresh authentication and send it back using either any message it has pending, or in a separateAUTH
message.The sender should retry the message (the receiver could not handle it right now, but a Retry might fix it).The sender sends a "fire and forget" style message.Request from Client: The Client want to subscribe to a Topic, the TopicId is specified in 'eid'.Reply from Server: Subscription went OK, but you've lost messages: The messageId that was referenced in theSUB
was not known to the server, implying that there are at least one message that has expired, but we don't know whether it was 1 or 1 million - so you won't get any of them "replayed".Reply from Server: Subscription was not authorized - no messages for this Topic will be delivered.Reply from Server: Subscription was OK.Request from Client: The Client want to unsubscribe from a Topic, the TopicId is specified in 'eid'.The reply to aHELLO
, where the MatsSocketSession is established, and the MatsSocketSessionId is returned. -
Method Summary
Modifier and TypeMethodDescriptionstatic MatsSocketServer.MessageType
Returns the enum constant of this class with the specified name.static MatsSocketServer.MessageType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HELLO
A HELLO message must be part of the first Pipeline of messages, preferably alone. One of the messages in the first Pipeline must have the "auth" field set, and it might as well be the HELLO. -
WELCOME
The reply to aHELLO
, where the MatsSocketSession is established, and the MatsSocketSessionId is returned. If you included a MatsSocketSessionId in the HELLO, signifying that you want to reconnect to an existing session, and you actually get a WELCOME back, it will be the same as what you provided - otherwise the connection is closed withMatsSocketServer.MatsSocketCloseCodes.SESSION_LOST
. -
SEND
The sender sends a "fire and forget" style message. -
REQUEST
-
RETRY
The sender should retry the message (the receiver could not handle it right now, but a Retry might fix it). -
ACK
The specified message was Received, and acknowledged positively - i.e. the other party has decided to process it. The sender of the ACK has now taken over responsibility of the specified message, put it (at least the reference ClientMessageId) in its Inbox, and possibly started processing it. The reason for the Inbox is so that if it Receives the message again, it may just insta-ACK/NACK it and toss this copy out the window (since it has already handled it). When an ACK is received, the receiver may safely delete the acknowledged message from its Outbox. -
NACK
The specified message was Received, but it did not acknowledge it - i.e. the other party has decided to NOT process it. The sender of the NACK has now taken over responsibility of the specified message, put it (at least the reference Client/Server MessageId) in its Inbox - but has evidently decided not to process it. The reason for the Inbox is so that if it Receives the message again, it may just insta-ACK/NACK it and toss this copy out the window (since it has already handled it). When an NACK is received, the receiver may safely delete the acknowledged message from its Outbox. -
ACK2
An "Acknowledge ^ 2", i.e. an acknowledge of theACK
orNACK
. When the receiver gets this, it may safely delete the entry it has for the specified message from its Inbox. The message is now fully transferred from one side to the other, and both parties again has no reference to this message in their Inbox and Outbox. -
RESOLVE
-
REJECT
-
SUB
Request from Client: The Client want to subscribe to a Topic, the TopicId is specified in 'eid'. -
UNSUB
Request from Client: The Client want to unsubscribe from a Topic, the TopicId is specified in 'eid'. -
SUB_OK
Reply from Server: Subscription was OK. If this is a reconnect, this indicates that any messages that was lost "while offline" will now be delivered/"replayed". -
SUB_LOST
Reply from Server: Subscription went OK, but you've lost messages: The messageId that was referenced in theSUB
was not known to the server, implying that there are at least one message that has expired, but we don't know whether it was 1 or 1 million - so you won't get any of them "replayed". You must therefore "get up to speed" by other means, e.g. if the subscription in question is some kind of cache delta-update mechanism, you will now have to reload the entire cache. -
SUB_NO_AUTH
Reply from Server: Subscription was not authorized - no messages for this Topic will be delivered. -
PUB
Topic message from Server: A message is issued on Topic, the TopicId is specified in 'eid', while the message is in 'msg'. -
REAUTH
The server requests that the Client re-authenticates, where the Client should immediately get a fresh authentication and send it back using either any message it has pending, or in a separateAUTH
message. Message processing - both processing of received messages, and sending of outgoing messages (i.e. Replies to REQUESTs, or Server-initiated SENDs and REQUESTs) will be stalled until such auth is gotten. -
AUTH
From Client: The client can use a separate AUTH message to send over the requestedREAUTH
(it could just as well put the 'auth' in a PING or any other message it had pending). -
PING
A PING, to which aPONG
is expected. -
PONG
A Reply to aPING
.
-
-
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
-