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.
Name | Description |
connection | ConnectionHandler The connection handler object setup with the ability to send/receive. |
Type | Description |
BootstrapMessage | The constructed wire message given the input message. |
Type | Description |
Exception | If construction or reading fails. |
sendStartupMessage(DataOutputStream output, int connectionId, int secret, OptionsMetadata options)
public static void sendStartupMessage(DataOutputStream output, int connectionId, int secret, OptionsMetadata options)
Expected PG start-up reply, including Auth approval, Key Data connection-specific info, PGAdapter specific parameters, and a ready signal.
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 |
options | OptionsMetadata |
Type | Description |
Exception |
Constructors
BootstrapMessage(ConnectionHandler connection, int length)
public BootstrapMessage(ConnectionHandler connection, int length)
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.
Name | Description |
rawParameters | String |
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.
Name | Description |
rawParameters | String The input string containing parameters (null delimited) |
Type | Description |
Map<String,String> | A KV map of the parameters |