|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mariadb.jdbc.internal.protocol.AbstractConnectProtocol
public abstract class AbstractConnectProtocol
| Field Summary | |
|---|---|
Results |
activeStreamingResult
|
protected int |
autoIncrementIncrement
|
protected boolean |
connected
|
protected HostAddress |
currentHost
|
protected String |
database
|
int |
dataTypeMappingFlags
|
protected boolean |
eofDeprecated
|
protected boolean |
explicitClosed
|
boolean |
hasWarnings
|
static byte[] |
IS_MASTER_QUERY
|
protected ReentrantLock |
lock
|
protected Options |
options
|
protected FailoverProxy |
proxy
|
protected PacketInputStream |
reader
|
protected boolean |
readOnly
|
protected long |
serverCapabilities
|
protected ServerPrepareStatementCache |
serverPrepareStatementCache
|
short |
serverStatus
|
protected long |
serverThreadId
|
static byte[] |
SESSION_QUERY
|
protected Socket |
socket
|
protected UrlParser |
urlParser
|
protected PacketOutputStream |
writer
|
| Constructor Summary | |
|---|---|
AbstractConnectProtocol(UrlParser urlParser,
ReentrantLock lock)
Get a protocol instance. |
|
| Method Summary | |
|---|---|
void |
changeSocketSoTimeout(int setSoTimeout)
|
void |
changeSocketTcpNoDelay(boolean setTcpNoDelay)
Change Socket TcpNoDelay option. |
boolean |
checkIfMaster()
Check that current connection is a master connection (not read-only) |
void |
close()
Closes socket and stream readers/writers Attempts graceful shutdown. |
protected static void |
close(PacketInputStream packetInputStream,
PacketOutputStream packetOutputStream,
Socket socket)
|
void |
connect()
Connect to currentHost. |
void |
connectWithoutProxy()
Connect without proxy. |
protected void |
enabledSslCipherSuites(SSLSocket sslSocket)
Set ssl socket cipher according to options. |
protected void |
enabledSslProtocolSuites(SSLSocket sslSocket)
Return possible protocols : values of option enabledSslProtocolSuites is set, or default to "TLSv1,TLSv1.1". |
abstract void |
executeQuery(String sql)
|
Results |
getActiveStreamingResult()
|
String |
getDatabase()
|
int |
getDataTypeMappingFlags()
|
String |
getHost()
|
HostAddress |
getHostAddress()
|
ReentrantLock |
getLock()
|
int |
getMajorServerVersion()
|
int |
getMinorServerVersion()
|
Options |
getOptions()
|
String |
getPassword()
|
boolean |
getPinGlobalTxToPhysicalConnection()
|
int |
getPort()
|
FailoverProxy |
getProxy()
|
PacketInputStream |
getReader()
|
boolean |
getReadonly()
|
String |
getServerData(String code)
|
long |
getServerThreadId()
|
String |
getServerVersion()
|
TimeZone |
getTimeZone()
|
String |
getTraces()
|
UrlParser |
getUrlParser()
|
String |
getUsername()
|
PacketOutputStream |
getWriter()
|
boolean |
hasMoreResults()
|
boolean |
hasWarnings()
Has warnings. |
boolean |
isClosed()
Is the connection closed. |
boolean |
isConnected()
Is connected. |
boolean |
isEofDeprecated()
|
boolean |
isExplicitClosed()
|
boolean |
isMasterConnection()
Indicate if current protocol is a master protocol. |
boolean |
isServerMariaDb()
|
boolean |
mustBeMasterConnection()
|
boolean |
noBackslashEscapes()
|
ServerPrepareStatementCache |
prepareStatementCache()
|
void |
readEofPacket()
Check that next read packet is a End-of-file packet. |
void |
readPipelineCheckMaster()
|
void |
removeActiveStreamingResult()
Remove exception result and since totally fetched, set fetch size to 0. |
void |
removeHasMoreResults()
|
void |
sendPipelineCheckMaster()
Send query to identify if server is master. |
boolean |
sessionStateAware()
|
void |
setActiveStreamingResult(Results activeStreamingResult)
|
void |
setHasWarnings(boolean hasWarnings)
|
void |
setHostAddress(HostAddress host)
|
void |
setHostFailedWithoutProxy()
|
void |
setProxy(FailoverProxy proxy)
|
void |
setReadonly(boolean readOnly)
|
void |
setServerStatus(short serverStatus)
|
boolean |
shouldReconnectWithoutProxy()
|
void |
skip()
Skip packets not read that are not needed. |
void |
skipEofPacket()
Check that next read packet is a End-of-file packet. |
boolean |
versionGreaterOrEqual(int major,
int minor,
int patch)
Utility method to check if database version is greater than parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte[] SESSION_QUERY
public static final byte[] IS_MASTER_QUERY
protected final ReentrantLock lock
protected final UrlParser urlParser
protected final Options options
public boolean hasWarnings
public Results activeStreamingResult
public int dataTypeMappingFlags
public short serverStatus
protected int autoIncrementIncrement
protected Socket socket
protected PacketOutputStream writer
protected boolean readOnly
protected PacketInputStream reader
protected HostAddress currentHost
protected FailoverProxy proxy
protected volatile boolean connected
protected boolean explicitClosed
protected String database
protected long serverThreadId
protected ServerPrepareStatementCache serverPrepareStatementCache
protected boolean eofDeprecated
protected long serverCapabilities
| Constructor Detail |
|---|
public AbstractConnectProtocol(UrlParser urlParser,
ReentrantLock lock)
urlParser - connection URL infoslock - the lock for thread synchronisation| Method Detail |
|---|
protected static void close(PacketInputStream packetInputStream,
PacketOutputStream packetOutputStream,
Socket socket)
throws SQLException
SQLExceptionpublic void close()
close in interface Protocol
public void skip()
throws SQLException
Lock must be set before using this method
skip in interface ProtocolSQLException - exceptionpublic void setServerStatus(short serverStatus)
setServerStatus in interface Protocolpublic void removeHasMoreResults()
removeHasMoreResults in interface Protocol
public void connect()
throws SQLException
connect in interface ProtocolSQLException - exceptionpublic boolean isClosed()
isClosed in interface Protocolpublic String getServerData(String code)
public boolean checkIfMaster()
throws SQLException
checkIfMaster in interface ProtocolSQLException - if requesting infos for server fail.
public void readEofPacket()
throws SQLException,
IOException
readEofPacket in interface ProtocolSQLException - if not a End-of-file packet
IOException - if connection error occur
public void skipEofPacket()
throws SQLException,
IOException
skipEofPacket in interface ProtocolSQLException - if not a End-of-file packet
IOException - if connection error occurpublic void setHostFailedWithoutProxy()
setHostFailedWithoutProxy in interface Protocolpublic UrlParser getUrlParser()
getUrlParser in interface Protocolpublic boolean isMasterConnection()
isMasterConnection in interface Protocol
public void sendPipelineCheckMaster()
throws IOException
IOException - in case of socket error.
public void readPipelineCheckMaster()
throws IOException,
SQLException
IOException
SQLExceptionpublic boolean mustBeMasterConnection()
mustBeMasterConnection in interface Protocolpublic boolean noBackslashEscapes()
noBackslashEscapes in interface Protocol
public void connectWithoutProxy()
throws SQLException
connectWithoutProxy in interface ProtocolSQLException - exceptionpublic boolean shouldReconnectWithoutProxy()
shouldReconnectWithoutProxy in interface Protocolpublic String getServerVersion()
getServerVersion in interface Protocolpublic boolean getReadonly()
getReadonly in interface Protocolpublic void setReadonly(boolean readOnly)
setReadonly in interface Protocolpublic HostAddress getHostAddress()
getHostAddress in interface Protocolpublic void setHostAddress(HostAddress host)
setHostAddress in interface Protocolpublic String getHost()
getHost in interface Protocolpublic FailoverProxy getProxy()
getProxy in interface Protocolpublic void setProxy(FailoverProxy proxy)
setProxy in interface Protocolpublic int getPort()
getPort in interface Protocolpublic String getDatabase()
getDatabase in interface Protocolpublic String getUsername()
getUsername in interface Protocolpublic String getPassword()
getPassword in interface Protocolpublic int getMajorServerVersion()
getMajorServerVersion in interface Protocolpublic int getMinorServerVersion()
getMinorServerVersion in interface Protocol
protected void enabledSslProtocolSuites(SSLSocket sslSocket)
throws SQLException
sslSocket - current sslSocket
SQLException - if protocol isn't a supported protocol
protected void enabledSslCipherSuites(SSLSocket sslSocket)
throws SQLException
sslSocket - current ssl socket
SQLException - if a cipher isn't known
public boolean versionGreaterOrEqual(int major,
int minor,
int patch)
versionGreaterOrEqual in interface Protocolmajor - major versionminor - minor versionpatch - patch version
public boolean getPinGlobalTxToPhysicalConnection()
getPinGlobalTxToPhysicalConnection in interface Protocolpublic boolean hasWarnings()
hasWarnings in interface Protocolpublic boolean isConnected()
isConnected in interface Protocolpublic long getServerThreadId()
getServerThreadId in interface Protocolpublic int getDataTypeMappingFlags()
getDataTypeMappingFlags in interface Protocolpublic boolean isExplicitClosed()
isExplicitClosed in interface Protocolpublic TimeZone getTimeZone()
getTimeZone in interface Protocolpublic Options getOptions()
getOptions in interface Protocolpublic void setHasWarnings(boolean hasWarnings)
setHasWarnings in interface Protocolpublic Results getActiveStreamingResult()
getActiveStreamingResult in interface Protocolpublic void setActiveStreamingResult(Results activeStreamingResult)
setActiveStreamingResult in interface Protocolpublic void removeActiveStreamingResult()
removeActiveStreamingResult in interface Protocolpublic ReentrantLock getLock()
getLock in interface Protocolpublic boolean hasMoreResults()
hasMoreResults in interface Protocolpublic ServerPrepareStatementCache prepareStatementCache()
prepareStatementCache in interface Protocol
public abstract void executeQuery(String sql)
throws SQLException
executeQuery in interface ProtocolSQLExceptionpublic void changeSocketTcpNoDelay(boolean setTcpNoDelay)
changeSocketTcpNoDelay in interface ProtocolsetTcpNoDelay - value to set.
public void changeSocketSoTimeout(int setSoTimeout)
throws SocketException
changeSocketSoTimeout in interface ProtocolSocketExceptionpublic boolean isServerMariaDb()
isServerMariaDb in interface Protocolpublic PacketInputStream getReader()
getReader in interface Protocolpublic PacketOutputStream getWriter()
getWriter in interface Protocolpublic boolean isEofDeprecated()
isEofDeprecated in interface Protocolpublic boolean sessionStateAware()
sessionStateAware in interface Protocolpublic String getTraces()
getTraces in interface Protocol
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||