Class ExtendedQueryProtocolHandler (0.6.1)

publicclassExtendedQueryProtocolHandler

Handles the message flow for the extended query protocol. Wire-protocol messages are buffered in memory until a flush/sync is received.

Inheritance

java.lang.Object > ExtendedQueryProtocolHandler

Constructors

ExtendedQueryProtocolHandler(ConnectionHandler connectionHandler)

publicExtendedQueryProtocolHandler(ConnectionHandlerconnectionHandler)

Creates an ExtendedQueryProtocolHandler for the given connection.

Parameter
NameDescription
connectionHandlerConnectionHandler

ExtendedQueryProtocolHandler(BackendConnection backendConnection)

publicExtendedQueryProtocolHandler(BackendConnectionbackendConnection)

Constructor only intended for testing.

Parameter
NameDescription
backendConnectionBackendConnection

Methods

buffer(AbstractQueryProtocolMessage message)

publicvoidbuffer(AbstractQueryProtocolMessagemessage)

Buffer an extended query protocol message for execution when the next flush/sync message is received.

Parameter
NameDescription
messageAbstractQueryProtocolMessage

flush()

publicvoidflush()

Flushes the current queue of messages. Any pending database statements are first executed, before sending the wire-protocol responses to the frontend. A flush does not commit the implicit transaction (if any).

Exceptions
TypeDescription
Exception

getBackendConnection()

publicBackendConnectiongetBackendConnection()

Returns the backend PG connection for this query handler.

Returns
TypeDescription
BackendConnection

sync()

publicvoidsync()

Flushes the current queue of messages and commits the implicit transaction (if any). Any pending database statements are first executed, before sending the wire-protocol responses to the frontend.

Exceptions
TypeDescription
Exception