public class NettyLumberjackEncoder extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.logging.log4j.Logger |
LOG |
| Constructor and Description |
|---|
NettyLumberjackEncoder(boolean compression) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDataToFrame(String key,
String value,
io.netty.buffer.ByteBuf buffer) |
void |
addSizeToFrame(int size,
io.netty.buffer.ByteBuf buffer) |
io.netty.buffer.ByteBuf |
endDataFrame(io.netty.buffer.ByteBuf buffer) |
String |
getCharset() |
byte[] |
getFrame(io.netty.buffer.ByteBuf dataFrame)
Convert one lumberjack frame to an encoded byte array
|
byte[] |
getFrame(io.netty.buffer.ByteBuf[] dataFrames,
int frameCount)
Deprecated.
|
static io.netty.buffer.ByteBuf |
prepareAckFrame(int sequenceNumber,
byte version)
Allocate and create a new ack frame with the corresponding sequence number
|
io.netty.buffer.ByteBuf |
prepareCompressFrame(io.netty.buffer.ByteBuf dataFrame)
If compression is enable return a compressed frame.
|
io.netty.buffer.ByteBuf |
prepareCompressFrame(io.netty.buffer.ByteBuf[] dataFrames)
Get a compressed frame out a several data frame.
|
io.netty.buffer.ByteBuf |
prepareDataFrame(Map<String,String> dataMap,
int sequenceNumber) |
io.netty.buffer.ByteBuf |
prepareDataFrame(String value,
int sequenceNumber) |
static io.netty.buffer.ByteBuf |
prepareKeepAliveFrame() |
void |
startDataFrame(int seqnum,
io.netty.buffer.ByteBuf buffer) |
static byte[] |
toByteArray(io.netty.buffer.ByteBuf buf)
Convert a ByteBuf to a byte array.
|
public NettyLumberjackEncoder(boolean compression)
compression - true or false to enable lumberjack compressionpublic io.netty.buffer.ByteBuf prepareCompressFrame(io.netty.buffer.ByteBuf dataFrame)
dataFrame - the input framepublic static byte[] toByteArray(io.netty.buffer.ByteBuf buf)
buf - public byte[] getFrame(io.netty.buffer.ByteBuf dataFrame)
dataFrame - the input lumberjack frame@Deprecated public byte[] getFrame(io.netty.buffer.ByteBuf[] dataFrames, int frameCount)
WATCH OUT : the returned ByteBuf can be empty, in case you give an array of
dataFrames - the input data lumberjack framesframeCount - the number of frames in the arraypublic io.netty.buffer.ByteBuf prepareCompressFrame(io.netty.buffer.ByteBuf[] dataFrames)
WATCH OUT : the returned ByteBuf can be empty, in case you give an array of
dataFrames - the input data lumberjack framespublic static io.netty.buffer.ByteBuf prepareAckFrame(int sequenceNumber,
byte version)
sequenceNumber - version - the version numberpublic io.netty.buffer.ByteBuf prepareDataFrame(String value, int sequenceNumber) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static io.netty.buffer.ByteBuf prepareKeepAliveFrame()
public io.netty.buffer.ByteBuf prepareDataFrame(Map<String,String> dataMap, int sequenceNumber) throws UnsupportedEncodingException
dataMap - the input map representing the document to sendsequenceNumber - the frame sequence numberUnsupportedEncodingExceptionpublic void startDataFrame(int seqnum,
io.netty.buffer.ByteBuf buffer)
public void addSizeToFrame(int size,
io.netty.buffer.ByteBuf buffer)
public void addDataToFrame(String key, String value, io.netty.buffer.ByteBuf buffer) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic io.netty.buffer.ByteBuf endDataFrame(io.netty.buffer.ByteBuf buffer)
public String getCharset()
Copyright © 2023. All rights reserved.