public class StartupMessage extends BootstrapMessage
The first (non-encryption, non-admin) message expected in from a client in a connection loop. Here we handle metadata and authentication if any.
Static Fields
IDENTIFIER
public static final int IDENTIFIER
Field Value | |
---|---|
Type | Description |
int |
Constructors
StartupMessage(ConnectionHandler connection, int length)
public StartupMessage(ConnectionHandler connection, int length)
Parameters | |
---|---|
Name | Description |
connection | ConnectionHandler |
length | int |
Methods
getHeaderLength()
protected int getHeaderLength()
How many bytes is taken by the payload header. Header is defined here as protocol definition + length. Most common value here is four bytes, so we keep that as default. Effectively, this is how much of the message you "don't" want to read from the message's total length with readAll.
Returns | |
---|---|
Type | Description |
int |
getIdentifier()
protected String getIdentifier()
Used for logging.
Returns | |
---|---|
Type | Description |
String |
getMessageName()
protected String getMessageName()
Used for logging.
Returns | |
---|---|
Type | Description |
String |
getParameters()
public Map<String,String> getParameters()
Returns | |
---|---|
Type | Description |
Map<String,String> |
getPayloadString()
protected String getPayloadString()
Used for logging.
Returns | |
---|---|
Type | Description |
String |
nextHandler()
public void nextHandler()
Here we expect the nextHandler to be PasswordMessage if we authenticate.
Exceptions | |
---|---|
Type | Description |
Exception |
sendPayload()
protected void sendPayload()
Override this method to include post-processing and metadata in the sending process. Template method for send.
Exceptions | |
---|---|
Type | Description |
Exception |