public abstract class BootstrapMessage extends WireMessage
This represents all messages which occur before ControlMessage type messages. Those include encryption, admin (e.g.: cancellation) and start-up messages.
Static Methods
create(ConnectionHandler connection)
public static BootstrapMessage create(ConnectionHandler connection)
Factory method to create the bootstrap message from their designated format. Note this is backwards from control messages where identifier is first and length second.
Parameter | |
---|---|
Name | Description |
connection | ConnectionHandler The connection handler object setup with the ability to send/receive. |
Returns | |
---|---|
Type | Description |
BootstrapMessage | The constructed wire message given the input message. |
Exceptions | |
---|---|
Type | Description |
Exception | If construction or reading fails. |
sendStartupMessage(DataOutputStream output, int connectionId, int secret, SessionState sessionState, Iterable<NoticeResponse> startupNotices)
public static void sendStartupMessage(DataOutputStream output, int connectionId, int secret, SessionState sessionState, Iterable<NoticeResponse> startupNotices)
Expected PG start-up reply, including Auth approval, Key Data connection-specific info, PGAdapter specific parameters, and a ready signal.
Parameters | |
---|---|
Name | Description |
output | DataOutputStream The data output stream to send results to. |
connectionId | int The connection Id representing the current connection to send to client. |
secret | int The secret apposite this connection |
sessionState | SessionState |
startupNotices | Iterable<NoticeResponse> |
Exceptions | |
---|---|
Type | Description |
Exception |
Constructors
BootstrapMessage(ConnectionHandler connection, int length)
public BootstrapMessage(ConnectionHandler connection, int length)
Parameters | |
---|---|
Name | Description |
connection | ConnectionHandler |
length | int |
Methods
parseParameterKeys(String rawParameters)
protected List<String> parseParameterKeys(String rawParameters)
Parses the parameter keys from the given raw parameter string and returns these in the received order. This can be used to detect the client that is connecting to PGAdapter.
Parameter | |
---|---|
Name | Description |
rawParameters | String |
Returns | |
---|---|
Type | Description |
List<String> |
parseParameters(String rawParameters)
protected Map<String,String> parseParameters(String rawParameters)
Parses parameters specific to bootstrap messages. Those generally (unlike control parameters) exclude metadata including length and are simple null (0) delimited.
Parameter | |
---|---|
Name | Description |
rawParameters | String The input string containing parameters (null delimited) |
Returns | |
---|---|
Type | Description |
Map<String,String> | A KV map of the parameters |