public abstract class AbstractConnectProtocol extends Object implements Protocol
| Modifier and Type | Field and Description |
|---|---|
MariaSelectResultSet |
activeStreamingResult |
protected boolean |
connected |
protected HostAddress |
currentHost |
protected String |
database |
int |
dataTypeMappingFlags |
protected boolean |
explicitClosed |
boolean |
hasWarnings |
protected ReentrantLock |
lock |
protected boolean |
moreResults |
boolean |
moreResultsTypeBinary |
protected Options |
options |
protected ReadPacketFetcher |
packetFetcher |
protected PrepareStatementCache |
prepareStatementCache |
protected FailoverProxy |
proxy |
protected boolean |
readOnly |
short |
serverStatus |
protected long |
serverThreadId |
protected Socket |
socket |
protected UrlParser |
urlParser |
protected PacketOutputStream |
writer |
| Constructor and Description |
|---|
AbstractConnectProtocol(UrlParser urlParser,
ReentrantLock lock)
Get a protocol instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcancelCurrentQuery, closeExplicit, executePreparedQuery, executePreparedQueryAfterFailover, executeQueries, executeQueries, executeQueriesRewrite, executeQuery, forceReleasePrepareStatement, getAutocommit, getMaxRows, getResult, getTimeout, getTransactionIsolationLevel, inTransaction, ping, prepare, prepare, prepareStatementCache, prolog, prologProxy, releasePrepareStatement, rollback, setCatalog, setInternalMaxRows, setLocalInfileInputStream, setMaxRows, setTimeout, setTransactionIsolationprotected final ReentrantLock lock
protected final UrlParser urlParser
protected final Options options
protected Socket socket
protected PacketOutputStream writer
protected boolean readOnly
protected ReadPacketFetcher packetFetcher
protected HostAddress currentHost
protected FailoverProxy proxy
protected volatile boolean connected
protected boolean explicitClosed
protected String database
protected long serverThreadId
protected PrepareStatementCache prepareStatementCache
protected boolean moreResults
public boolean moreResultsTypeBinary
public boolean hasWarnings
public MariaSelectResultSet activeStreamingResult
public int dataTypeMappingFlags
public short serverStatus
public AbstractConnectProtocol(UrlParser urlParser, ReentrantLock lock)
urlParser - connection URL infoslock - the lock for thread synchronisationpublic void skip()
throws SQLException,
QueryException
skip in interface ProtocolQueryException - exceptionSQLExceptionpublic abstract void getMoreResults(ExecutionResult executionResult) throws QueryException
getMoreResults in interface ProtocolQueryExceptionpublic void setMoreResults(boolean moreResults,
boolean isBinary)
setMoreResults in interface Protocolpublic void close()
protected static void close(ReadPacketFetcher fetcher, PacketOutputStream packetOutputStream, Socket socket) throws QueryException
QueryExceptionpublic void connect()
throws QueryException
connect in interface ProtocolQueryException - exceptionpublic boolean isClosed()
public String getServerData(String code)
getServerData in interface Protocolpublic boolean checkIfMaster()
throws QueryException
checkIfMaster in interface ProtocolQueryExceptionpublic void readEofPacket()
throws QueryException,
IOException
QueryException - if not a End-of-file packetIOException - if connection error occurpublic void setHostFailedWithoutProxy()
setHostFailedWithoutProxy in interface Protocolpublic UrlParser getUrlParser()
getUrlParser in interface Protocolpublic boolean isMasterConnection()
isMasterConnection in interface Protocolpublic boolean mustBeMasterConnection()
mustBeMasterConnection in interface Protocolpublic boolean noBackslashEscapes()
noBackslashEscapes in interface Protocolpublic void connectWithoutProxy()
throws QueryException
connectWithoutProxy in interface ProtocolQueryException - 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 FailoverProxy getProxy()
public void setProxy(FailoverProxy proxy)
public 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 Protocolpublic boolean versionGreaterOrEqual(int major,
int minor,
int patch)
versionGreaterOrEqual in interface Protocolmajor - major versionminor - minor versionpatch - patch versionpublic 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 Calendar getCalendar()
getCalendar in interface Protocolpublic Options getOptions()
getOptions in interface Protocolpublic void setHasWarnings(boolean hasWarnings)
setHasWarnings in interface Protocolpublic MariaSelectResultSet getActiveStreamingResult()
getActiveStreamingResult in interface Protocolpublic void setActiveStreamingResult(MariaSelectResultSet activeStreamingResult)
setActiveStreamingResult in interface Protocolpublic ReentrantLock getLock()
public boolean hasMoreResults()
hasMoreResults in interface Protocolpublic PrepareStatementCache getPrepareStatementCache()
public abstract void executeQuery(String sql) throws QueryException
executeQuery in interface ProtocolQueryExceptionCopyright © 2016. All rights reserved.