| Modifier and Type | Field and Description |
|---|---|
| private Map | |
| private CompressionAlgorithm | |
| private boolean | |
| private String | |
| private ResultStreamer | |
| private String | |
| private String | |
| public String | |
| private Closeable | managedResource
We take responsibility of the socket as the managed resource. |
| private Map | |
| private Map | |
| private ReferenceQueue | |
| private SequentialIdLease | |
| private MessageReader | |
| private static int | |
| private int | |
| private MessageSender | |
| pack-priv XServerSession | |
| private boolean | supportsPreparedStatements
Keeps track of whether this X Server session supports prepared statements. |
| pack-priv Boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | changeUser(String
DB user name user, String DB user password password, String database name database)Implements com. Re-authenticates as the given user and password |
| public XMessage | checkErrorMessage()
Implements com. Read one message from the MySQL server, checks for errors in it, and if none, returns the message, ready for reading |
| public void | |
| public void | |
| public void | connect(String
DB user name user, String DB user password password, String database name database)Implements com. Create a new session. |
| public void | |
| public boolean | Returns: true if the exception was properly handledthe id of the prepared statement that failed to prepare preparedStatementId, XProtocolError e)Informs this protocol instance that preparing a statement on the connected server failed. |
| public void | freePreparedStatementId(int
the prepared statement id to release preparedStatementId)Frees a prepared statement id so that it can be reused. |
| private Map | Returns: a map with all the supported compression algorithms, both natively supported and user configured.the value of the option 'xdevapi.compression-algorithm' containing a comma separated list of triplets with the format
"algorithm-name:inflater-InputStream-class-name:deflater-OutputStream-class-name". compressionExtensions)Parses and validates the value given for the connection option 'xdevapi.compression-extensions'. |
| private Map | |
| public ExceptionInterceptor | |
| public InputStream | getLocalInfileInputStream()
Implements com. Returns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement. |
| public int | Returns: a new identifier to be used as prepared statement idReturns an id to be used as a client-managed prepared statement id. The method |
| public ServerSession | |
| public Supplier | |
| public boolean | |
| public boolean | |
| public void | init(Session sess, SocketConnection socketConn, PropertySet propSet, TransactionEventHandler trManager)
Overrides com. Implements com. Init method takes the place of constructor. |
| public void | |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| protected void | |
| public <M extends Message, R extends QueryResult> R | |
| public <M extends Message, R extends QueryResult> CompletableFuture | |
| public <T extends ProtocolEntity> T | read(Class<T> requiredClass, ProtocolEntityFactory<T, XMessage> protocolEntityFactory)
Implements com.
|
| public <T extends ProtocolEntity> T | read(Class<Resultset>
required Resultset class requiredClass, int the maximum number of rows to read (-1 means all rows) maxRows, boolean should the driver leave the results on the wire,
and read them only when needed? streamResults, XMessage the first packet of information in the result set resultPacket, boolean true if the binary protocol is used (for server prepared statements) isBinaryEncoded, ColumnDefinition use this metadata instead of the one provided on wire metadata, ProtocolEntityFactory<T, XMessage> ProtocolEntityFactory instanceImplements com. Read protocol entity. |
| public byte[] | |
| public void | |
| public XMessage | readMessage(XMessage
Message instance to read into, may be nullImplements com. Read one message from the MySQL server into the reusable buffer if provided or into the new one. |
| public ColumnDefinition | |
| public ColumnDefinition | |
| public ColumnDefinition | |
| public <T extends QueryResult> T | readQueryResult(ResultBuilder<T>
ResultBuilder instanceImplements com. Read messages from server and deliver them to resultBuilder. |
| public XProtocolRow | |
| public ServerCapabilities | Returns: capabilities mapped by nameImplements com. Get the capabilities from the server. |
| public boolean | Returns: true if enough executions have been done since last time a prepared statement failed to prepareChecks if enough statements have been executed in this MySQL server so that another prepare statement attempt should be done. |
| public void | reset()
Overrides com. Implements com. Return Protocol to its initial state right after successful connect. |
| public void | send(Message
Message instancelength of header + payload packetLen)Implements com.
|
| public void | sendCapabilities(Map<String, Object>
capabilities name/value map keyValuePair)Set client capabilities of current session. |
| public XMessage | sendCommand(Message
a packet pre-loaded with data for the protocol (eg.
from a client-side prepared statement). The first byte of
this packet is the MySQL protocol 'command' from MysqlDefs queryPacket, boolean do not call checkErrorPacket() if true skipCheck, int timeout timeoutMillis)Implements com. Send a command to the MySQL server. |
| public void | setLocalInfileInputStream(InputStream
input stream stream)Implements com. Sets an InputStream instance that will be used to send data to the MySQL server for a "LOAD DATA LOCAL INFILE" statement rather than a FileInputStream or URLInputStream that represents the path given as an argument to the statement. |
| public void | |
| public boolean | Returns: true if the MySQL server currently connected supports prepared statements.Checks if the MySQL server currently connected supports prepared statements. |
| public boolean | versionMeetsMinimum(int major, int minor, int subminor)
Implements com.
|
| clientCapabilities | back to summary |
|---|---|
| private Map<String, Object> clientCapabilities | |
| compressionAlgorithm | back to summary |
|---|---|
| private CompressionAlgorithm compressionAlgorithm | |
| compressionEnabled | back to summary |
|---|---|
| private boolean compressionEnabled | |
| currDatabase | back to summary |
|---|---|
| private String currDatabase | |
| currentResultStreamer | back to summary |
|---|---|
| private ResultStreamer currentResultStreamer | |
| currPassword | back to summary |
|---|---|
| private String currPassword | |
| currUser | back to summary |
|---|---|
| private String currUser | |
| defaultSchemaName | back to summary |
|---|---|
| public String defaultSchemaName | |
| managedResource | back to summary |
|---|---|
| private Closeable managedResource We take responsibility of the socket as the managed resource. We close it when we're done. | |
| messageToProtocolEntityFactory | back to summary |
|---|---|
| private Map<Class<? extends Message>, ProtocolEntityFactory<? extends ProtocolEntity, XMessage>> messageToProtocolEntityFactory | |
| preparableStatementFinalizerReferences | back to summary |
|---|---|
| private Map<Integer, PreparableStatement. | |
| preparableStatementRefQueue | back to summary |
|---|---|
| private ReferenceQueue<PreparableStatement<?>> preparableStatementRefQueue | |
| preparedStatementIds | back to summary |
|---|---|
| private SequentialIdLease preparedStatementIds | |
| reader | back to summary |
|---|---|
| private MessageReader<XMessageHeader, XMessage> reader | |
| RETRY_PREPARE_STATEMENT_COUNTDOWN | back to summary |
|---|---|
| private static int RETRY_PREPARE_STATEMENT_COUNTDOWN | |
| retryPrepareStatementCountdown | back to summary |
|---|---|
| private int retryPrepareStatementCountdown | |
| sender | back to summary |
|---|---|
| private MessageSender<XMessage> sender | |
| serverSession | back to summary |
|---|---|
| pack-priv XServerSession serverSession | |
| supportsPreparedStatements | back to summary |
|---|---|
| private boolean supportsPreparedStatements Keeps track of whether this X Server session supports prepared statements. True by default until first failure of a statement prepare. | |
| useSessionResetKeepOpen | back to summary |
|---|---|
| pack-priv Boolean useSessionResetKeepOpen | |
| XProtocol | back to summary |
|---|---|
| public XProtocol(HostInfo hostInfo, PropertySet propertySet) | |
| afterHandshake | back to summary |
|---|---|
| public void afterHandshake() Implements com.
| |
| beforeHandshake | back to summary |
|---|---|
| public void beforeHandshake() Implements com.
| |
| changeDatabase | back to summary |
|---|---|
| public void changeDatabase(String database) Implements com.
| |
| changeUser | back to summary |
|---|---|
| public void changeUser(String user, String password, String database) Implements com. Doc from com. Re-authenticates as the given user and password | |
| checkErrorMessage | back to summary |
|---|---|
| public XMessage checkErrorMessage() Implements com. Doc from com. Read one message from the MySQL server, checks for errors in it, and if none, returns the message, ready for reading | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements com.
| |
| configureTimeZone | back to summary |
|---|---|
| public void configureTimeZone() Implements com.
| |
| connect | back to summary |
|---|---|
| public void connect(String user, String password, String database) Implements com. Doc from com. Create a new session. This generally happens once at the beginning of a connection. | |
| drainRows | back to summary |
|---|---|
| public void drainRows() Used only in tests | |
| failedPreparingStatement | back to summary |
|---|---|
| public boolean failedPreparingStatement(int preparedStatementId, XProtocolError e) Informs this protocol instance that preparing a statement on the connected server failed.
| |
| freePreparedStatementId | back to summary |
|---|---|
| public void freePreparedStatementId(int preparedStatementId) Frees a prepared statement id so that it can be reused. Note that freeing an id from an active prepared statement will result in a statement prepare conflict next time one gets prepared with the same released id.
| |
| getCompressionExtensions | back to summary |
|---|---|
| private Map Parses and validates the value given for the connection option 'xdevapi.compression-extensions'. With the information obtained, creates a map of supported compression algorithms.
| |
| getConnectionAttributesMap | back to summary |
|---|---|
| private Map | |
| getExceptionInterceptor | back to summary |
|---|---|
| public ExceptionInterceptor getExceptionInterceptor() Overrides com. Implements com.
| |
| getLocalInfileInputStream | back to summary |
|---|---|
| public InputStream getLocalInfileInputStream() Implements com. Doc from com. Returns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement. This method returns NULL if no such stream has been set via setLocalInfileInputStream().
| |
| getNewPreparedStatementId | back to summary |
|---|---|
| public int getNewPreparedStatementId(PreparableStatement<?> preparableStatement) Returns an id to be used as a client-managed prepared statement id. The method
| |
| getServerSession | back to summary |
|---|---|
| public ServerSession getServerSession() Implements com.
| |
| getValueEncoderSupplier | back to summary |
|---|---|
| public Supplier Implements com.
| |
| hasMoreResults | back to summary |
|---|---|
| public boolean hasMoreResults() | |
| hasResults | back to summary |
|---|---|
| public boolean hasResults() Used only in tests
| |
| init | back to summary |
|---|---|
| public void init(Session sess, SocketConnection socketConn, PropertySet propSet, TransactionEventHandler trManager) Overrides com. Implements com. Doc from com. Init method takes the place of constructor. A constructor should be used unless the encapsulation of ProtocolFactory is necessary.
| |
| initServerSession | back to summary |
|---|---|
| public void initServerSession() Implements com.
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() | |
| isSqlResultPending | back to summary |
|---|---|
| public boolean isSqlResultPending() | |
| negotiateCompression | back to summary |
|---|---|
| public void negotiateCompression() Negotiates compression capabilities with the server. | |
| negotiateSSLConnection | back to summary |
|---|---|
| public void negotiateSSLConnection() Implements com.
| |
| newCommand | back to summary |
|---|---|
| protected void newCommand() Signal the intent to start processing a new command. A session supports processing a single command at a time. Results are read lazily from the wire. It is necessary to flush any pending result before starting a new command. This method performs the flush if necessary. | |
| query | back to summary |
|---|---|
| public <M extends Message, R extends QueryResult> R query(M message, ResultBuilder<R> resultBuilder) | |
| queryAsync | back to summary |
|---|---|
| public <M extends Message, R extends QueryResult> CompletableFuture | |
| read | back to summary |
|---|---|
| public <T extends ProtocolEntity> T read(Class<T> requiredClass, ProtocolEntityFactory<T, XMessage> protocolEntityFactory) throws IOException Implements com.
| |
| read | back to summary |
|---|---|
| public <T extends ProtocolEntity> T read(Class<Resultset> requiredClass, int maxRows, boolean streamResults, XMessage resultPacket, boolean isBinaryEncoded, ColumnDefinition metadata, ProtocolEntityFactory<T, XMessage> protocolEntityFactory) throws IOException Implements com. Doc from com. Read protocol entity.
| |
| readAuthenticateContinue | back to summary |
|---|---|
| public byte[] readAuthenticateContinue() | |
| readAuthenticateOk | back to summary |
|---|---|
| public void readAuthenticateOk() | |
| readMessage | back to summary |
|---|---|
| public XMessage readMessage(XMessage reuse) Implements com. Doc from com. Read one message from the MySQL server into the reusable buffer if provided or into the new one. | |
| readMetadata | back to summary |
|---|---|
| public ColumnDefinition readMetadata() Implements com.
| |
| readMetadata | back to summary |
|---|---|
| public ColumnDefinition readMetadata(Consumer<Notice> noticeConsumer) | |
| readMetadata | back to summary |
|---|---|
| public ColumnDefinition readMetadata(Field f, Consumer<Notice> noticeConsumer) | |
| readQueryResult | back to summary |
|---|---|
| public <T extends QueryResult> T readQueryResult(ResultBuilder<T> resultBuilder) Implements com. Doc from com. Read messages from server and deliver them to resultBuilder.
| |
| readRowOrNull | back to summary |
|---|---|
| public XProtocolRow readRowOrNull(ColumnDefinition metadata, Consumer<Notice> noticeConsumer) | |
| readServerCapabilities | back to summary |
|---|---|
| public ServerCapabilities readServerCapabilities() Implements com. Get the capabilities from the server. Note This must be called before authentication.
| |
| readyForPreparingStatements | back to summary |
|---|---|
| public boolean readyForPreparingStatements() Checks if enough statements have been executed in this MySQL server so that another prepare statement attempt should be done.
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides com. Implements com. Doc from com. Return Protocol to its initial state right after successful connect.
| |
| send | back to summary |
|---|---|
| public void send(Message message, int packetLen) Implements com.
| |
| sendCapabilities | back to summary |
|---|---|
| public void sendCapabilities(Map<String, Object> keyValuePair) Set client capabilities of current session. Must be done before authentication ( | |
| sendCommand | back to summary |
|---|---|
| public XMessage sendCommand(Message queryPacket, boolean skipCheck, int timeoutMillis) Implements com. Doc from com. Send a command to the MySQL server.
| |
| setLocalInfileInputStream | back to summary |
|---|---|
| public void setLocalInfileInputStream(InputStream stream) Implements com. Doc from com. Sets an InputStream instance that will be used to send data to the MySQL server for a "LOAD DATA LOCAL INFILE" statement rather than a FileInputStream or URLInputStream that represents the path given as an argument to the statement. This stream will be read to completion upon execution of a "LOAD DATA LOCAL INFILE" statement, and will automatically be closed by the driver, so it needs to be reset before each call to execute*() that would cause the MySQL server to request data to fulfill the request for "LOAD DATA LOCAL INFILE". If this value is set to NULL, the driver will revert to using a FileInputStream or URLInputStream as required.
| |
| setMaxAllowedPacket | back to summary |
|---|---|
| public void setMaxAllowedPacket(int maxAllowedPacket) | |
| supportsPreparedStatements | back to summary |
|---|---|
| public boolean supportsPreparedStatements() Checks if the MySQL server currently connected supports prepared statements.
| |
| versionMeetsMinimum | back to summary |
|---|---|
| public boolean versionMeetsMinimum(int major, int minor, int subminor) Implements com.
| |