Package com.mysql.cj.protocol
Class AbstractProtocol<M extends Message>
java.lang.Object
com.mysql.cj.protocol.AbstractProtocol<M>
- All Implemented Interfaces:
Protocol<M>
- Direct Known Subclasses:
NativeProtocol,XProtocol
public abstract class AbstractProtocol<M extends Message> extends java.lang.Object implements Protocol<M>
-
Field Summary
Fields Modifier and Type Field Description protected AuthenticationProvider<M>authProviderprotected ExceptionInterceptorexceptionInterceptorprotected LoglogThe logger we're going to useprotected MessageBuilder<M>messageBuilderprotected java.util.LinkedList<java.lang.StringBuilder>packetDebugRingBufferprotected PropertySetpropertySetprotected java.lang.StringqueryTimingUnitsprotected Sessionsessionprotected SocketConnectionsocketConnectionprotected TransactionEventHandlertransactionManagerprotected booleanuseNanosForElapsedTime -
Constructor Summary
Constructors Constructor Description AbstractProtocol() -
Method Summary
Modifier and Type Method Description AuthenticationProvider<M>getAuthenticationProvider()ExceptionInterceptorgetExceptionInterceptor()MessageBuilder<M>getMessageBuilder()PacketReceivedTimeHoldergetPacketReceivedTimeHolder()PacketSentTimeHoldergetPacketSentTimeHolder()PropertySetgetPropertySet()java.lang.StringgetQueryTimingUnits()SocketConnectiongetSocketConnection()voidinit(Session sess, SocketConnection phConnection, PropertySet propSet, TransactionEventHandler trManager)Init method takes the place of constructor.voidreset()Return Protocol to its initial state right after successful connect.voidsetPacketReceivedTimeHolder(PacketReceivedTimeHolder packetReceivedTimeHolder)voidsetPacketSentTimeHolder(PacketSentTimeHolder packetSentTimeHolder)voidsetPropertySet(PropertySet propertySet)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mysql.cj.protocol.Protocol
afterHandshake, beforeHandshake, changeDatabase, changeUser, checkErrorMessage, close, configureTimeZone, connect, getLocalInfileInputStream, getPasswordCharacterEncoding, getQueryComment, getServerSession, initServerSession, negotiateSSLConnection, read, read, readMessage, readMetadata, readQueryResult, readServerCapabilities, send, sendCommand, setLocalInfileInputStream, setQueryComment, versionMeetsMinimum
-
Field Details
-
session
-
socketConnection
-
propertySet
-
transactionManager
-
log
The logger we're going to use -
exceptionInterceptor
-
authProvider
-
messageBuilder
-
packetDebugRingBuffer
protected java.util.LinkedList<java.lang.StringBuilder> packetDebugRingBuffer -
useNanosForElapsedTime
protected boolean useNanosForElapsedTime -
queryTimingUnits
protected java.lang.String queryTimingUnits
-
-
Constructor Details
-
AbstractProtocol
public AbstractProtocol()
-
-
Method Details
-
init
public void init(Session sess, SocketConnection phConnection, PropertySet propSet, TransactionEventHandler trManager)Description copied from interface:ProtocolInit method takes the place of constructor. A constructor should be used unless the encapsulation of ProtocolFactory is necessary.- Specified by:
initin interfaceProtocol<M extends Message>- Parameters:
sess-SessionphConnection-SocketConnectionpropSet-PropertySettrManager-TransactionEventHandler
-
getSocketConnection
- Specified by:
getSocketConnectionin interfaceProtocol<M extends Message>
-
getAuthenticationProvider
- Specified by:
getAuthenticationProviderin interfaceProtocol<M extends Message>
-
getExceptionInterceptor
- Specified by:
getExceptionInterceptorin interfaceProtocol<M extends Message>
-
getPacketSentTimeHolder
- Specified by:
getPacketSentTimeHolderin interfaceProtocol<M extends Message>
-
setPacketSentTimeHolder
- Specified by:
setPacketSentTimeHolderin interfaceProtocol<M extends Message>
-
getPacketReceivedTimeHolder
- Specified by:
getPacketReceivedTimeHolderin interfaceProtocol<M extends Message>
-
setPacketReceivedTimeHolder
- Specified by:
setPacketReceivedTimeHolderin interfaceProtocol<M extends Message>
-
getPropertySet
- Specified by:
getPropertySetin interfaceProtocol<M extends Message>
-
setPropertySet
- Specified by:
setPropertySetin interfaceProtocol<M extends Message>
-
getMessageBuilder
- Specified by:
getMessageBuilderin interfaceProtocol<M extends Message>
-
reset
public void reset()Description copied from interface:ProtocolReturn Protocol to its initial state right after successful connect. -
getQueryTimingUnits
public java.lang.String getQueryTimingUnits()- Specified by:
getQueryTimingUnitsin interfaceProtocol<M extends Message>
-