public abstract class PgsqlMessageHandler<T extends PgsqlMessage> extends io.netty.handler.codec.MessageToMessageDecoder<PgsqlRawMessage>
| Modifier and Type | Field and Description |
|---|---|
protected Map<Byte,Class<? extends T>> |
msgTypes |
protected int |
numberOfPeerChannels |
protected int |
preferredPeerChannel |
| Modifier | Constructor and Description |
|---|---|
protected |
PgsqlMessageHandler(Class<? extends T>... msgTypes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptInboundMessage(Object msg) |
protected io.netty.buffer.ByteBuf |
allocate(io.netty.channel.ChannelHandlerContext ctx,
T msg,
io.netty.buffer.ByteBuf buffer) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
protected T |
decode(io.netty.channel.ChannelHandlerContext ctx,
byte type,
io.netty.buffer.ByteBuf content) |
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
PgsqlRawMessage rawMsg,
List<Object> out) |
protected void |
decodeStream(io.netty.channel.ChannelHandlerContext ctx,
byte type,
MutableByteBufInputStream in) |
protected void |
decodeStream(io.netty.channel.ChannelHandlerContext ctx,
PgsqlRawMessage rawMsg) |
protected List<DirectedMessage<T>> |
directedProcess(io.netty.channel.ChannelHandlerContext ctx,
T msg) |
protected io.netty.buffer.ByteBuf |
encode(io.netty.channel.ChannelHandlerContext ctx,
T msg) |
protected io.netty.buffer.ByteBuf |
encode(io.netty.channel.ChannelHandlerContext ctx,
T msg,
io.netty.buffer.ByteBuf buffer) |
protected EventProcessor |
getEventProcessor(io.netty.channel.ChannelHandlerContext ctx) |
protected int |
getNumberOfPeerChannels(io.netty.channel.ChannelHandlerContext ctx) |
protected <M extends T> |
getParser(io.netty.channel.ChannelHandlerContext ctx,
Class<? extends T> msgType) |
protected PgsqlSession |
getPgsqlSession(io.netty.channel.ChannelHandlerContext ctx) |
protected int |
getPreferredPeerChannel(io.netty.channel.ChannelHandlerContext ctx) |
protected PgsqlConfiguration |
getPsqlConfiguration(io.netty.channel.ChannelHandlerContext ctx) |
protected SQLSession |
getSqlSession(io.netty.channel.ChannelHandlerContext ctx) |
protected <M extends PgsqlMessage> |
getWriter(io.netty.channel.ChannelHandlerContext ctx,
Class<? extends PgsqlMessage> msgType) |
protected boolean |
isStreamingSupported(byte type) |
protected T |
process(io.netty.channel.ChannelHandlerContext ctx,
T msg) |
protected void |
sendErrorResponse(io.netty.channel.ChannelHandlerContext ctx,
Map<Byte,CString> errorDetails) |
protected <M extends PgsqlMessage> |
sendRequest(io.netty.channel.ChannelHandlerContext ctx,
M msg,
int backend) |
protected <M extends PgsqlMessage> |
sendResponse(io.netty.channel.ChannelHandlerContext ctx,
M msg) |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredhandlerAdded, handlerRemoved, isSharableprotected final Map<Byte,Class<? extends T extends PgsqlMessage>> msgTypes
protected int numberOfPeerChannels
protected int preferredPeerChannel
@SafeVarargs protected PgsqlMessageHandler(Class<? extends T>... msgTypes)
public boolean acceptInboundMessage(Object msg) throws Exception
acceptInboundMessage in class io.netty.handler.codec.MessageToMessageDecoder<PgsqlRawMessage>Exceptionpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.handler.codec.MessageToMessageDecoder<PgsqlRawMessage>Exceptionprotected void decode(io.netty.channel.ChannelHandlerContext ctx,
PgsqlRawMessage rawMsg,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.MessageToMessageDecoder<PgsqlRawMessage>Exceptionprotected void decodeStream(io.netty.channel.ChannelHandlerContext ctx,
PgsqlRawMessage rawMsg)
throws IOException
IOExceptionprotected boolean isStreamingSupported(byte type)
protected void decodeStream(io.netty.channel.ChannelHandlerContext ctx,
byte type,
MutableByteBufInputStream in)
throws IOException
IOExceptionprotected T decode(io.netty.channel.ChannelHandlerContext ctx, byte type, io.netty.buffer.ByteBuf content) throws IOException
IOExceptionprotected List<DirectedMessage<T>> directedProcess(io.netty.channel.ChannelHandlerContext ctx, T msg) throws IOException
IOExceptionprotected T process(io.netty.channel.ChannelHandlerContext ctx, T msg) throws IOException
IOExceptionprotected io.netty.buffer.ByteBuf allocate(io.netty.channel.ChannelHandlerContext ctx,
T msg,
io.netty.buffer.ByteBuf buffer)
protected io.netty.buffer.ByteBuf encode(io.netty.channel.ChannelHandlerContext ctx,
T msg)
throws IOException
IOExceptionprotected io.netty.buffer.ByteBuf encode(io.netty.channel.ChannelHandlerContext ctx,
T msg,
io.netty.buffer.ByteBuf buffer)
throws IOException
IOExceptionprotected <M extends T> PgsqlMessageParser<M> getParser(io.netty.channel.ChannelHandlerContext ctx, Class<? extends T> msgType)
protected <M extends PgsqlMessage> PgsqlMessageWriter<M> getWriter(io.netty.channel.ChannelHandlerContext ctx, Class<? extends PgsqlMessage> msgType)
protected int getNumberOfPeerChannels(io.netty.channel.ChannelHandlerContext ctx)
protected int getPreferredPeerChannel(io.netty.channel.ChannelHandlerContext ctx)
protected PgsqlConfiguration getPsqlConfiguration(io.netty.channel.ChannelHandlerContext ctx)
protected PgsqlSession getPgsqlSession(io.netty.channel.ChannelHandlerContext ctx)
protected SQLSession getSqlSession(io.netty.channel.ChannelHandlerContext ctx)
protected EventProcessor getEventProcessor(io.netty.channel.ChannelHandlerContext ctx)
protected void sendErrorResponse(io.netty.channel.ChannelHandlerContext ctx,
Map<Byte,CString> errorDetails)
throws IOException
IOExceptionprotected <M extends PgsqlMessage> void sendResponse(io.netty.channel.ChannelHandlerContext ctx, M msg) throws IOException
IOExceptionprotected <M extends PgsqlMessage> void sendRequest(io.netty.channel.ChannelHandlerContext ctx, M msg, int backend) throws IOException
IOExceptionCopyright © 2017 The CLARUS Consortium. All rights reserved.