Class AbstractBinaryMemcacheEncoder<M extends BinaryMemcacheMessage>
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Object>
com.couchbase.client.deps.io.netty.handler.codec.memcache.AbstractMemcacheObjectEncoder<M>
com.couchbase.client.deps.io.netty.handler.codec.memcache.binary.AbstractBinaryMemcacheEncoder<M>
- All Implemented Interfaces:
ChannelHandler
,ChannelOutboundHandler
- Direct Known Subclasses:
BinaryMemcacheRequestEncoder
,BinaryMemcacheResponseEncoder
public abstract class AbstractBinaryMemcacheEncoder<M extends BinaryMemcacheMessage> extends AbstractMemcacheObjectEncoder<M>
A
MessageToByteEncoder
that encodes binary memache messages into bytes.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Constructor Summary
Constructors Constructor Description AbstractBinaryMemcacheEncoder()
-
Method Summary
Modifier and Type Method Description protected abstract void
encodeHeader(ByteBuf buf, M msg)
Encode the header.protected ByteBuf
encodeMessage(ChannelHandlerContext ctx, M msg)
Take the givenMemcacheMessage
and encode it into a writableByteBuf
.Methods inherited from class com.couchbase.client.deps.io.netty.handler.codec.memcache.AbstractMemcacheObjectEncoder
acceptOutboundMessage, encode
Methods inherited from class io.netty.handler.codec.MessageToMessageEncoder
write
Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
Constructor Details
-
AbstractBinaryMemcacheEncoder
public AbstractBinaryMemcacheEncoder()
-
-
Method Details
-
encodeMessage
Description copied from class:AbstractMemcacheObjectEncoder
Take the givenMemcacheMessage
and encode it into a writableByteBuf
.- Specified by:
encodeMessage
in classAbstractMemcacheObjectEncoder<M extends BinaryMemcacheMessage>
- Parameters:
ctx
- the channel handler context.msg
- the message to encode.- Returns:
- the
ByteBuf
representation of the message.
-
encodeHeader
Encode the header.This methods needs to be implemented by a sub class because the header is different for both requests and responses.
- Parameters:
buf
- theByteBuf
to write into.msg
- the message to encode.
-