|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
org.mariadb.jdbc.internal.io.output.AbstractPacketOutputStream
public abstract class AbstractPacketOutputStream
| Field Summary | |
|---|---|
protected byte[] |
buf
|
protected long |
cmdLength
|
protected static Logger |
logger
|
protected int |
maxAllowedPacket
|
protected int |
maxQuerySizeToLog
|
protected boolean |
permitTrace
|
protected int |
pos
|
protected int |
seqNo
|
protected String |
serverThreadLog
|
protected LruTraceCache |
traceCache
|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
AbstractPacketOutputStream(OutputStream out,
int maxQuerySizeToLog)
Common feature to write data into socket, creating MySQL Packet. |
|
| Method Summary | |
|---|---|
void |
checkMaxAllowedLength(int length)
Count query size. |
boolean |
checkRemainingSize(int len)
|
void |
flush()
Send packet to socket. |
protected abstract void |
flushBuffer(boolean commandEnd)
|
int |
getMaxAllowedPacket()
|
abstract int |
getMaxPacketLength()
|
OutputStream |
getOutputStream()
|
boolean |
isAllowedCmdLength()
|
void |
permitTrace(boolean permitTrace)
|
abstract void |
setMaxAllowedPacket(int maxAllowedPacket)
|
void |
setServerThreadId(long serverThreadId,
Boolean isMaster)
Set server thread id. |
void |
setTraceCache(LruTraceCache traceCache)
|
abstract void |
startPacket(int seqNo)
|
void |
write(byte[] arr)
|
void |
write(byte[] arr,
int off,
int len)
Write byte array to buffer. |
void |
write(InputStream is,
boolean escape,
boolean noBackslashEscapes)
Write stream into socket. |
void |
write(InputStream is,
long length,
boolean escape,
boolean noBackslashEscapes)
Write stream into socket. |
void |
write(int value)
Write byte into buffer, flush buffer to socket if needed. |
void |
write(Reader reader,
boolean escape,
boolean noBackslashEscapes)
Write reader into socket. |
void |
write(Reader reader,
long length,
boolean escape,
boolean noBackslashEscapes)
Write reader into socket. |
void |
write(String str)
|
void |
write(String str,
boolean escape,
boolean noBackslashEscapes)
Write string to socket. |
void |
writeBytes(byte value,
int len)
Write byte value, len times into buffer. flush buffer if too small. |
void |
writeBytesEscaped(byte[] bytes,
int len,
boolean noBackslashEscapes)
Write escape bytes to socket. |
abstract void |
writeEmptyPacket()
|
void |
writeEmptyPacket(int seqNo)
Send empty packet. |
void |
writeFieldLength(long length)
Write field length into buffer, flush socket if needed. |
void |
writeInt(int value)
Write int value into buffer. flush buffer if too small. |
void |
writeLong(long value)
Write long value into buffer. flush buffer if too small. |
void |
writeShort(short value)
Write short value into buffer. flush buffer if too small. |
| Methods inherited from class java.io.FilterOutputStream |
|---|
close |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.mariadb.jdbc.internal.io.output.PacketOutputStream |
|---|
close |
| Field Detail |
|---|
protected static Logger logger
protected byte[] buf
protected int pos
protected int maxAllowedPacket
protected int maxQuerySizeToLog
protected long cmdLength
protected boolean permitTrace
protected int seqNo
protected String serverThreadLog
protected LruTraceCache traceCache
| Constructor Detail |
|---|
public AbstractPacketOutputStream(OutputStream out,
int maxQuerySizeToLog)
out - socket outputStreammaxQuerySizeToLog - maximum query size to log| Method Detail |
|---|
public abstract int getMaxPacketLength()
public abstract void startPacket(int seqNo)
startPacket in interface PacketOutputStream
protected abstract void flushBuffer(boolean commandEnd)
throws IOException
IOException
public void writeEmptyPacket(int seqNo)
throws IOException
writeEmptyPacket in interface PacketOutputStreamseqNo - packet sequence
IOException - if socket error occur.
public abstract void writeEmptyPacket()
throws IOException
writeEmptyPacket in interface PacketOutputStreamIOException
public void flush()
throws IOException
flush in interface Flushableflush in interface PacketOutputStreamflush in class FilterOutputStreamIOException - if socket error occur.public boolean checkRemainingSize(int len)
checkRemainingSize in interface PacketOutputStream
public void checkMaxAllowedLength(int length)
throws MaxAllowedPacketException
length - additional length to query size
MaxAllowedPacketException - if query has not to be send.public boolean isAllowedCmdLength()
isAllowedCmdLength in interface PacketOutputStreampublic OutputStream getOutputStream()
getOutputStream in interface PacketOutputStream
public void writeShort(short value)
throws IOException
writeShort in interface PacketOutputStreamvalue - short value
IOException - if socket error occur
public void writeInt(int value)
throws IOException
writeInt in interface PacketOutputStreamvalue - int value
IOException - if socket error occur
public void writeLong(long value)
throws IOException
writeLong in interface PacketOutputStreamvalue - long value
IOException - if socket error occur
public void writeBytes(byte value,
int len)
throws IOException
writeBytes in interface PacketOutputStreamvalue - byte valuelen - number of time to write value.
IOException - if socket error occur.
public void writeFieldLength(long length)
throws IOException
writeFieldLength in interface PacketOutputStreamlength - field length
IOException - if socket error occur.
public void write(int value)
throws IOException
write in interface PacketOutputStreamwrite in class FilterOutputStreamvalue - byte to send
IOException - if socket error occur.
public void write(byte[] arr)
throws IOException
write in interface PacketOutputStreamwrite in class FilterOutputStreamIOException
public void write(byte[] arr,
int off,
int len)
throws IOException
write in interface PacketOutputStreamwrite in class FilterOutputStreamarr - byte arrayoff - offsetlen - byte length to write
IOException - if socket error occur
public void write(String str)
throws IOException
write in interface PacketOutputStreamIOException
public void write(String str,
boolean escape,
boolean noBackslashEscapes)
throws IOException
write in interface PacketOutputStreamstr - stringescape - must be escapenoBackslashEscapes - escape method
IOException - if socket error occur
public void write(InputStream is,
boolean escape,
boolean noBackslashEscapes)
throws IOException
write in interface PacketOutputStreamis - inputStreamescape - must be escapenoBackslashEscapes - escape method
IOException - if socket error occur
public void write(InputStream is,
long length,
boolean escape,
boolean noBackslashEscapes)
throws IOException
write in interface PacketOutputStreamis - inputStreamlength - write lengthescape - must be escapenoBackslashEscapes - escape method
IOException - if socket error occur
public void write(Reader reader,
boolean escape,
boolean noBackslashEscapes)
throws IOException
write in interface PacketOutputStreamreader - readerescape - must be escapenoBackslashEscapes - escape method
IOException - if socket error occur
public void write(Reader reader,
long length,
boolean escape,
boolean noBackslashEscapes)
throws IOException
write in interface PacketOutputStreamreader - readerlength - write lengthescape - must be escapenoBackslashEscapes - escape method
IOException - if socket error occur
public void writeBytesEscaped(byte[] bytes,
int len,
boolean noBackslashEscapes)
throws IOException
writeBytesEscaped in interface PacketOutputStreambytes - byteslen - len to writenoBackslashEscapes - escape method
IOException - if socket error occurpublic int getMaxAllowedPacket()
getMaxAllowedPacket in interface PacketOutputStreampublic abstract void setMaxAllowedPacket(int maxAllowedPacket)
setMaxAllowedPacket in interface PacketOutputStreampublic void permitTrace(boolean permitTrace)
permitTrace in interface PacketOutputStream
public void setServerThreadId(long serverThreadId,
Boolean isMaster)
setServerThreadId in interface PacketOutputStreamserverThreadId - current server thread id.isMaster - is server masterpublic void setTraceCache(LruTraceCache traceCache)
setTraceCache in interface PacketOutputStream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||