final class Protocol
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static byte |
AUTH_CHALLENGE
Sent by server
byte 0: AUTH_CHALLENGE
byte 1..n: challenge body
|
(package private) static byte |
AUTH_COMPLETE
Sent by server
byte 0: AUTH_COMPLETE
|
(package private) static byte |
AUTH_REJECTED
Sent by server
byte 0: AUTH_REJECTED
|
(package private) static byte |
AUTH_REQUEST
Sent by client
byte 0: AUTH_REQUEST
byte 1..n: request body
|
(package private) static byte |
AUTH_RESPONSE
Sent by client
byte 0: AUTH_RESPONSE
byte 1..n: response body
|
(package private) static int |
BH_FAULTY_MSG_SIZE
Bad message size flag.
|
(package private) static int |
BH_MESSAGE_CLOSE
Message close protocol flag.
|
(package private) static byte |
CAP_CHANNELS_IN |
(package private) static byte |
CAP_CHANNELS_OUT |
(package private) static byte |
CAP_ENDPOINT_NAME |
(package private) static byte |
CAP_MESSAGE_CLOSE |
(package private) static byte |
CAP_SASL_MECH |
(package private) static byte |
CAP_STARTTLS |
(package private) static byte |
CAP_VERSION |
(package private) static byte |
CAP_VERSION_STRING |
(package private) static byte |
CAPABILITIES
Sent by client then server.
|
(package private) static byte |
CHANNEL_CLOSED
byte 0: CHANNEL_CLOSE_READ
byte 1..4: channel ID
Sent when a channel is closed without necessarily consuming all of its incoming messages.
|
(package private) static byte |
CHANNEL_OPEN_ACK
byte 0: CHANNEL_OPEN_ACK
byte 1..4: channel ID (MSb = 0)
byte 5..n: agreed parameters (see Channel Open Parameters below)
inbound = responder->requester
outbound = requester->responder
|
(package private) static byte |
CHANNEL_OPEN_REQUEST
byte 0: CHANNEL_OPEN_REQUEST
byte 1..4: new channel ID (MSb = 1)
byte n+1..m: requested parameters (see Channel Open Parameters below)
O_SERVICE_NAME is required
inbound = responder->requester
outbound = requester->responder |
(package private) static byte |
CHANNEL_SHUTDOWN_WRITE
byte 0: CHANNEL_CLOSE_WRITE
byte 1..4: channel ID
Sent when channel writes are shut down.
|
(package private) static byte |
CONNECTION_ALIVE
byte 0: CONNECTION_ALIVE
byte 1..n: random padding (optional)
|
(package private) static byte |
CONNECTION_ALIVE_ACK
byte 0: CONNECTION_ALIVE
byte 1..n: random padding (optional)
|
(package private) static byte |
CONNECTION_CLOSE
byte 0: CONNECTION_CLOSE
No packets may be sent afterwards.
|
(package private) static byte |
GREETING
Sent by server only.
|
(package private) static byte |
GRT_SERVER_NAME |
(package private) static byte |
MESSAGE_CLOSE
byte 0: MESSAGE_CLOSE
byte 1..4: channel ID
byte 5..6: message ID
Always flows from message recipient to message sender.
|
(package private) static byte |
MESSAGE_DATA
byte 0: MESSAGE_DATA
byte 1..4: channel ID
byte 5..6: message ID
byte 7: flags: - - - - - C N E C = Cancelled N = New E = EOF
byte 8..n: message content
Always flows from message sender to message recipient.
|
(package private) static byte |
MESSAGE_WINDOW_OPEN
byte 0: MESSAGE_WINDOW_OPEN
byte 1..4: channel ID
byte 5..6: message ID
byte 7..10: window open amount
Always flows from message recipient to message sender.
|
(package private) static byte |
MSG_FLAG_CANCELLED |
(package private) static byte |
MSG_FLAG_EOF |
(package private) static byte |
MSG_FLAG_NEW |
(package private) static byte |
NAK
Sent by server when message is not understood or invalid.
|
(package private) static int |
O_END
End of parameters; no content.
|
(package private) static int |
O_MAX_INBOUND_MSG_COUNT
Max requester-bound message count; mandatory uint16 content.
|
(package private) static int |
O_MAX_INBOUND_MSG_SIZE
Max requester-bound message size; mandatory uint63 content.
|
(package private) static int |
O_MAX_INBOUND_MSG_WINDOW_SIZE
Max inbound message window size; mandatory uint31 content.
|
(package private) static int |
O_MAX_OUTBOUND_MSG_COUNT
Max responder-bound message count; mandatory uint16 content.
|
(package private) static int |
O_MAX_OUTBOUND_MSG_SIZE
Max responder-bound message size; mandatory uint63 content.
|
(package private) static int |
O_MAX_OUTBOUND_MSG_WINDOW_SIZE
Max responder-bound message window size; mandatory uint31 content.
|
(package private) static int |
O_SERVICE_NAME
Service name; mandatory utf8 content.
|
(package private) static byte |
SERVICE_ERROR
byte 0: SERVICE_ERROR
byte 1..4: channel ID (MSb = 0)
byte 5..n: reason UTF8
|
(package private) static byte |
SERVICE_NOT_FOUND
byte 0: SERVICE_NOT_FOUND
byte 1..4: channel ID (MSb = 0)
|
(package private) static byte |
STARTTLS
Sent by client then server
byte 0: STARTTLS
|
(package private) static java.nio.charset.Charset |
UTF_8 |
(package private) static byte |
VERSION
The highest-supported version of the remote protocol supported by this implementation.
|
| Modifier | Constructor and Description |
|---|---|
private |
Protocol() |
static final int BH_MESSAGE_CLOSE
true, the remote side knows how to participate in proper async
close protocol; if false, just wing it and hope for the best.static final int BH_FAULTY_MSG_SIZE
true, we know that the remote side is going to do the following:
1) Open the internal inbound window size by 8 bytes too many per acknowledged incoming message... and kill the
connection if more than 2**29 messages are received due to the window "flipping" to negative values
2) Send an ack/window open which is sized 8 bytes too large per incoming message
3) Shrink its internal outbound window size by 8 bytes too many per outgoing message
To compensate we must:
1) Avoid "crashing" the window which will gradually open too much over time
2) Shrink our internal outbound window counter by an extra 8 bytes per outbound message
3) Send message ACKs which are oversized by an extra 8 bytes per inbound message to prevent the window from sliding shut over timestatic final byte VERSION
static final byte GREETING
static final byte CAPABILITIES
static final byte AUTH_REQUEST
static final byte AUTH_CHALLENGE
static final byte AUTH_RESPONSE
static final byte AUTH_COMPLETE
static final byte AUTH_REJECTED
static final byte STARTTLS
static final byte NAK
static final byte CHANNEL_OPEN_REQUEST
O_SERVICE_NAME is required
inbound = responder->requester
outbound = requester->responderstatic final byte CHANNEL_OPEN_ACK
static final byte SERVICE_NOT_FOUND
static final byte SERVICE_ERROR
static final byte CHANNEL_SHUTDOWN_WRITE
static final byte CHANNEL_CLOSED
static final byte MESSAGE_DATA
static final byte MESSAGE_WINDOW_OPEN
static final byte MESSAGE_CLOSE
static final byte CONNECTION_ALIVE
static final byte CONNECTION_ALIVE_ACK
static final byte CONNECTION_CLOSE
static final int O_END
static final int O_SERVICE_NAME
static final int O_MAX_INBOUND_MSG_WINDOW_SIZE
static final int O_MAX_INBOUND_MSG_COUNT
static final int O_MAX_OUTBOUND_MSG_WINDOW_SIZE
static final int O_MAX_OUTBOUND_MSG_COUNT
static final int O_MAX_INBOUND_MSG_SIZE
static final int O_MAX_OUTBOUND_MSG_SIZE
static final byte CAP_VERSION
static final byte CAP_SASL_MECH
static final byte CAP_STARTTLS
static final byte CAP_ENDPOINT_NAME
static final byte CAP_MESSAGE_CLOSE
static final byte CAP_VERSION_STRING
static final byte CAP_CHANNELS_IN
static final byte CAP_CHANNELS_OUT
static final byte GRT_SERVER_NAME
static final java.nio.charset.Charset UTF_8
static final byte MSG_FLAG_EOF
static final byte MSG_FLAG_NEW
static final byte MSG_FLAG_CANCELLED