T
- The type of SourceQueryRequest
this decoder will handle/processpublic abstract class SourceQueryDecoder<T extends SourceQueryRequest> extends MessageInboundHandler
SourceQueryPacket
or a SourceQueryResponse
Modifier and Type | Class and Description |
---|---|
protected static class |
SourceQueryDecoder.SourceQueryMessage |
Constructor and Description |
---|
SourceQueryDecoder() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
acceptPacket(SourceQueryDecoder.SourceQueryMessage msg)
acceptPacket.
|
protected <A,B> void |
decodeField(String name,
io.netty.buffer.ByteBuf buf,
Function<io.netty.buffer.ByteBuf,A> reader,
Consumer<B> writer)
Decode as a field from the given
ByteBuf . |
protected <A,B> void |
decodeField(String name,
io.netty.buffer.ByteBuf buf,
Function<io.netty.buffer.ByteBuf,A> reader,
Consumer<B> writer,
Function<A,B> transformer)
Decode as a field from the given
ByteBuf . |
protected <A,B> void |
decodeField(String name,
io.netty.buffer.ByteBuf buf,
Supplier<A> reader,
Consumer<B> writer)
Decode as a field from the given
ByteBuf . |
protected <A,B> void |
decodeField(String name,
io.netty.buffer.ByteBuf buf,
Supplier<A> reader,
Consumer<B> writer,
Function<A,B> transformer)
Decode as a field from the given
ByteBuf . |
protected <V> V |
decodeField(String name,
V defaultValue,
io.netty.buffer.ByteBuf buf,
Function<io.netty.buffer.ByteBuf,V> decoder)
Decode as a field from the given
ByteBuf . |
protected <A,B> void |
decodeFlag(String name,
io.netty.buffer.ByteBuf buf,
int flags,
int flag,
Function<io.netty.buffer.ByteBuf,A> reader,
Consumer<B> writer)
Decodes a flag from the provided int value.
|
protected <A,B> void |
decodeFlag(String name,
io.netty.buffer.ByteBuf buf,
int flags,
int flag,
Function<io.netty.buffer.ByteBuf,A> reader,
Consumer<B> writer,
Function<A,B> transformer)
Decodes a flag from the provided int value.
|
protected <A,B> void |
decodeFlag(String name,
io.netty.buffer.ByteBuf buf,
int flags,
int flag,
Supplier<A> reader,
Consumer<B> writer)
Decodes a flag from the provided int value.
|
protected <A,B> void |
decodeFlag(String name,
io.netty.buffer.ByteBuf buf,
int flags,
int flag,
Supplier<A> reader,
Consumer<B> writer,
Function<A,B> transformer)
Decodes a flag from the provided int value.
|
protected abstract Object |
decodePacket(io.netty.channel.ChannelHandlerContext ctx,
T request,
SourceQuerySinglePacket msg)
decodePacket.
|
void |
readMessage(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
readMessage.
|
channelRead, debug, debug, debug, debug, error, error, handlerAdded, handlerRemoved, info, isDebugEnabled, log, log, printField, trace, warn
public final void readMessage(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
readMessage.
readMessage
in class MessageInboundHandler
ctx
- a ChannelHandlerContext
objectmsg
- a Object
objectException
- if any.protected abstract boolean acceptPacket(SourceQueryDecoder.SourceQueryMessage msg)
acceptPacket.
msg
- a SourceQueryDecoder.SourceQueryMessage
objectprotected abstract Object decodePacket(io.netty.channel.ChannelHandlerContext ctx, T request, SourceQuerySinglePacket msg) throws Exception
decodePacket.
ctx
- a ChannelHandlerContext
objectrequest
- a T objectmsg
- a SourceQuerySinglePacket
objectObject
objectException
- if any.protected <A,B> void decodeFlag(String name, io.netty.buffer.ByteBuf buf, int flags, int flag, Supplier<A> reader, Consumer<B> writer) throws DecodeException
Decodes a flag from the provided int value.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectflags
- a intflag
- a intreader
- a Supplier
objectwriter
- a Consumer
objectDecodeException
- if any.protected <A,B> void decodeFlag(String name, io.netty.buffer.ByteBuf buf, int flags, int flag, Supplier<A> reader, Consumer<B> writer, Function<A,B> transformer) throws DecodeException
Decodes a flag from the provided int value.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectflags
- a intflag
- a intreader
- a Supplier
objectwriter
- a Consumer
objecttransformer
- a Function
objectDecodeException
- if any.protected <A,B> void decodeFlag(String name, io.netty.buffer.ByteBuf buf, int flags, int flag, Function<io.netty.buffer.ByteBuf,A> reader, Consumer<B> writer, Function<A,B> transformer) throws DecodeException
Decodes a flag from the provided int value.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectflags
- a intflag
- a intreader
- a Function
objectwriter
- a Consumer
objecttransformer
- a Function
objectDecodeException
- if any.protected <A,B> void decodeFlag(String name, io.netty.buffer.ByteBuf buf, int flags, int flag, Function<io.netty.buffer.ByteBuf,A> reader, Consumer<B> writer) throws DecodeException
Decodes a flag from the provided int value.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectflags
- a intflag
- a intreader
- a Function
objectwriter
- a Consumer
objectDecodeException
- if any.protected <A,B> void decodeField(String name, io.netty.buffer.ByteBuf buf, Supplier<A> reader, Consumer<B> writer) throws DecodeException
Decode as a field from the given ByteBuf
.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectreader
- a Supplier
objectwriter
- a Consumer
objectDecodeException
- if any.protected <A,B> void decodeField(String name, io.netty.buffer.ByteBuf buf, Supplier<A> reader, Consumer<B> writer, Function<A,B> transformer) throws DecodeException
Decode as a field from the given ByteBuf
.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectreader
- a Supplier
objectwriter
- a Consumer
objecttransformer
- a Function
objectDecodeException
- if any.protected <A,B> void decodeField(String name, io.netty.buffer.ByteBuf buf, Function<io.netty.buffer.ByteBuf,A> reader, Consumer<B> writer, Function<A,B> transformer) throws DecodeException
Decode as a field from the given ByteBuf
.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectreader
- a Function
objectwriter
- a Consumer
objecttransformer
- a Function
objectDecodeException
- if any.protected <A,B> void decodeField(String name, io.netty.buffer.ByteBuf buf, Function<io.netty.buffer.ByteBuf,A> reader, Consumer<B> writer) throws DecodeException
Decode as a field from the given ByteBuf
.
A
- a A classB
- a B classname
- a String
objectbuf
- a ByteBuf
objectreader
- a Function
objectwriter
- a Consumer
objectDecodeException
- if any.protected <V> V decodeField(String name, V defaultValue, io.netty.buffer.ByteBuf buf, Function<io.netty.buffer.ByteBuf,V> decoder) throws DecodeException
Decode as a field from the given ByteBuf
.
V
- a V classname
- a String
objectdefaultValue
- a V objectbuf
- a ByteBuf
objectdecoder
- a Function
objectDecodeException
- if any.Copyright © 2016–2024. All rights reserved.