Class StartupMessage (0.18.2)

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.

Inheritance

java.lang.Object > WireMessage > BootstrapMessage > StartupMessage

Static Fields

IDENTIFIER

public static final int IDENTIFIER
Field Value
TypeDescription
int

Constructors

StartupMessage(ConnectionHandler connection, int length)

public StartupMessage(ConnectionHandler connection, int length)
Parameters
NameDescription
connectionConnectionHandler
lengthint

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
TypeDescription
int
Overrides

getIdentifier()

protected String getIdentifier()

Used for logging.

Returns
TypeDescription
String
Overrides

getMessageName()

protected String getMessageName()

Used for logging.

Returns
TypeDescription
String
Overrides

getParameters()

public Map<String,String> getParameters()
Returns
TypeDescription
Map<String,String>

getPayloadString()

protected String getPayloadString()

Used for logging.

Returns
TypeDescription
String
Overrides

nextHandler()

public void nextHandler()

Here we expect the nextHandler to be PasswordMessage if we authenticate.

Overrides Exceptions
TypeDescription
Exception

sendPayload()

protected void sendPayload()

Override this method to include post-processing and metadata in the sending process. Template method for send.

Overrides Exceptions
TypeDescription
Exception