public class DefaultCommandWriter<C extends Command> extends java.lang.Object implements CommandWriter<C>
| Constructor and Description |
|---|
DefaultCommandWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected java.nio.ByteBuffer |
composeByteBuffer(C command,
BlockingChannel channel,
java.util.function.Function<C,byte[]> commandBodyExtractor) |
void |
log(C command,
ProtocolVersion protocolVersion) |
void |
setVersion(ProtocolVersion version) |
void |
setVersionAfterNextWrite(ProtocolVersion version) |
void |
write(C command,
BlockingChannel channel,
boolean needsFlushing) |
void |
writeBufferToChannel(java.nio.ByteBuffer buff,
C command,
BlockingChannel channel,
boolean needsFlushing) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwritepublic void write(C command, BlockingChannel channel, boolean needsFlushing) throws java.io.IOException, DisconnectionException
write in interface CommandWriter<C extends Command>java.io.IOExceptionDisconnectionExceptionprotected java.nio.ByteBuffer composeByteBuffer(C command, BlockingChannel channel, java.util.function.Function<C,byte[]> commandBodyExtractor) throws DisconnectionException
DisconnectionExceptionpublic void writeBufferToChannel(java.nio.ByteBuffer buff,
C command,
BlockingChannel channel,
boolean needsFlushing)
throws DisconnectionException,
java.io.IOException
DisconnectionExceptionjava.io.IOExceptionpublic void setVersion(ProtocolVersion version)
setVersion in interface CommandWriter<C extends Command>public void setVersionAfterNextWrite(ProtocolVersion version)
setVersionAfterNextWrite in interface CommandWriter<C extends Command>public void log(C command, ProtocolVersion protocolVersion)