Package com.mysql.cj.protocol.x
Class XMessageBuilder
java.lang.Object
com.mysql.cj.protocol.x.XMessageBuilder
- All Implemented Interfaces:
MessageBuilder<XMessage>
public class XMessageBuilder extends java.lang.Object implements MessageBuilder<XMessage>
-
Constructor Summary
Constructors Constructor Description XMessageBuilder()
-
Method Summary
Modifier and Type Method Description XMessage
buildCapabilitiesGet()
XMessage
buildCapabilitiesSet(java.util.Map<java.lang.String,java.lang.Object> keyValuePair)
XMessage
buildClose()
XMessage
buildCreateCollection(java.lang.String schemaName, java.lang.String collectionName)
XMessage
buildCreateCollection(java.lang.String schemaName, java.lang.String collectionName, Schema.CreateCollectionOptions options)
XMessage
buildCreateCollectionIndex(java.lang.String schemaName, java.lang.String collectionName, CreateIndexParams params)
XMessage
buildDelete(FilterParams filterParams)
Build anXMessage
for a non-prepared delete operation.XMessage
buildDisableNotices(java.lang.String... notices)
XMessage
buildDocInsert(java.lang.String schemaName, java.lang.String collectionName, java.util.List<java.lang.String> json, boolean upsert)
Build anXMessage
for a non-prepared doc insert operation.XMessage
buildDocUpdate(FilterParams filterParams, java.util.List<UpdateSpec> updates)
Build anXMessage
for a non-prepared doc update operation.XMessage
buildDropCollection(java.lang.String schemaName, java.lang.String collectionName)
XMessage
buildDropCollectionIndex(java.lang.String schemaName, java.lang.String collectionName, java.lang.String indexName)
XMessage
buildEnableNotices(java.lang.String... notices)
XMessage
buildExpectOpen()
XMessage
buildExternalAuthStart(java.lang.String database)
XMessage
buildFind(FilterParams filterParams)
Build anXMessage
for a non-prepared find operation.XMessage
buildListNotices()
List the notices the server allows subscribing to.XMessage
buildListObjects(java.lang.String schemaName, java.lang.String pattern)
List the objects in the given schema.XMessage
buildModifyCollectionOptions(java.lang.String schemaName, java.lang.String collectionName, Schema.ModifyCollectionOptions options)
XMessage
buildMysql41AuthContinue(java.lang.String user, java.lang.String password, byte[] salt, java.lang.String database)
XMessage
buildMysql41AuthStart()
XMessage
buildPlainAuthStart(java.lang.String user, java.lang.String password, java.lang.String database)
XMessage
buildPrepareDeallocate(int preparedStatementId)
Build anXMessage
for deallocating a prepared statement.XMessage
buildPrepareDelete(int preparedStatementId, FilterParams filterParams)
Build anXMessage
for a prepared delete operation.XMessage
buildPrepareDocUpdate(int preparedStatementId, FilterParams filterParams, java.util.List<UpdateSpec> updates)
Build anXMessage
for a prepared doc update operation.XMessage
buildPrepareExecute(int preparedStatementId, FilterParams filterParams)
Build anXMessage
for executing a prepared statement with the given filters.XMessage
buildPrepareFind(int preparedStatementId, FilterParams filterParams)
Build anXMessage
for a prepared find operation.XMessage
buildPrepareRowUpdate(int preparedStatementId, FilterParams filterParams, UpdateParams updateParams)
Build anXMessage
for a prepared row update operation.XMessage
buildPrepareSqlStatement(int preparedStatementId, java.lang.String statement)
Build a Prepare message for a SQL statement.XMessage
buildRowInsert(java.lang.String schemaName, java.lang.String tableName, InsertParams insertParams)
Build anXMessage
for a non-prepared row insert operation.XMessage
buildRowUpdate(FilterParams filterParams, UpdateParams updateParams)
Build anXMessage
for a non-prepared row update operation.XMessage
buildSessionResetAndClose()
XMessage
buildSessionResetKeepOpen()
XMessage
buildSha256MemoryAuthContinue(java.lang.String user, java.lang.String password, byte[] nonce, java.lang.String database)
XMessage
buildSha256MemoryAuthStart()
XMessage
buildSqlStatement(java.lang.String statement)
Build a StmtExecute message for a SQL statement.XMessage
buildSqlStatement(java.lang.String statement, java.util.List<java.lang.Object> args)
Build a StmtExecute message for a SQL statement.
-
Constructor Details
-
XMessageBuilder
public XMessageBuilder()
-
-
Method Details
-
buildCapabilitiesGet
-
buildCapabilitiesSet
public XMessage buildCapabilitiesSet(java.util.Map<java.lang.String,java.lang.Object> keyValuePair) -
buildDocInsert
public XMessage buildDocInsert(java.lang.String schemaName, java.lang.String collectionName, java.util.List<java.lang.String> json, boolean upsert)Build anXMessage
for a non-prepared doc insert operation.- Parameters:
schemaName
- the schema namecollectionName
- the collection namejson
- the documents to insertupsert
- Whether this is an upsert operation or not- Returns:
- an
XMessage
instance
-
buildRowInsert
public XMessage buildRowInsert(java.lang.String schemaName, java.lang.String tableName, InsertParams insertParams)Build anXMessage
for a non-prepared row insert operation.- Parameters:
schemaName
- the schema nametableName
- the table nameinsertParams
- the parameters to insert- Returns:
- an
XMessage
instance
-
buildDocUpdate
Build anXMessage
for a non-prepared doc update operation.- Parameters:
filterParams
- the filter parametersupdates
- the updates specifications to perform- Returns:
- an
XMessage
instance
-
buildPrepareDocUpdate
public XMessage buildPrepareDocUpdate(int preparedStatementId, FilterParams filterParams, java.util.List<UpdateSpec> updates)Build anXMessage
for a prepared doc update operation.- Parameters:
preparedStatementId
- the prepared statement idfilterParams
- the filter parametersupdates
- the updates specifications to perform- Returns:
- an
XMessage
instance
-
buildRowUpdate
Build anXMessage
for a non-prepared row update operation.- Parameters:
filterParams
- the filter parametersupdateParams
- the update parameters- Returns:
- an
XMessage
instance
-
buildPrepareRowUpdate
public XMessage buildPrepareRowUpdate(int preparedStatementId, FilterParams filterParams, UpdateParams updateParams)Build anXMessage
for a prepared row update operation.- Parameters:
preparedStatementId
- the prepared statement idfilterParams
- the filter parametersupdateParams
- the update parameters- Returns:
- an
XMessage
instance
-
buildFind
Build anXMessage
for a non-prepared find operation.- Parameters:
filterParams
- the filter parameters- Returns:
- an
XMessage
instance
-
buildPrepareFind
Build anXMessage
for a prepared find operation.- Parameters:
preparedStatementId
- the prepared statement idfilterParams
- the filter parameters- Returns:
- an
XMessage
instance
-
buildDelete
Build anXMessage
for a non-prepared delete operation.- Parameters:
filterParams
- the filter parameters- Returns:
- an
XMessage
instance
-
buildPrepareDelete
Build anXMessage
for a prepared delete operation.- Parameters:
preparedStatementId
- the prepared statement idfilterParams
- the filter parameters- Returns:
- an
XMessage
instance
-
buildSqlStatement
Build a StmtExecute message for a SQL statement.- Specified by:
buildSqlStatement
in interfaceMessageBuilder<XMessage>
- Parameters:
statement
- SQL statement string- Returns:
XMessage
wrappingMysqlxSql.StmtExecute
-
buildSqlStatement
public XMessage buildSqlStatement(java.lang.String statement, java.util.List<java.lang.Object> args)Build a StmtExecute message for a SQL statement.- Specified by:
buildSqlStatement
in interfaceMessageBuilder<XMessage>
- Parameters:
statement
- SQL statement stringargs
- list ofObject
arguments- Returns:
XMessage
wrappingMysqlxSql.StmtExecute
-
buildPrepareSqlStatement
Build a Prepare message for a SQL statement.- Parameters:
preparedStatementId
- the prepared statement idstatement
- SQL statement string- Returns:
XMessage
wrappingMysqlxSql.StmtExecute
-
buildPrepareExecute
Build anXMessage
for executing a prepared statement with the given filters.- Parameters:
preparedStatementId
- the prepared statement idfilterParams
- the filter parameter values- Returns:
- an
XMessage
instance
-
buildPrepareDeallocate
Build anXMessage
for deallocating a prepared statement.- Parameters:
preparedStatementId
- the prepared statement id- Returns:
- an
XMessage
instance
-
buildCreateCollection
public XMessage buildCreateCollection(java.lang.String schemaName, java.lang.String collectionName, Schema.CreateCollectionOptions options) -
buildModifyCollectionOptions
public XMessage buildModifyCollectionOptions(java.lang.String schemaName, java.lang.String collectionName, Schema.ModifyCollectionOptions options) -
buildCreateCollection
public XMessage buildCreateCollection(java.lang.String schemaName, java.lang.String collectionName) -
buildDropCollection
-
buildClose
- Specified by:
buildClose
in interfaceMessageBuilder<XMessage>
-
buildListObjects
List the objects in the given schema. Returns a table as so:| name | type | |---------------------+------------| | CollectionTest | COLLECTION | | some_view | VIEW | | xprotocol_test_test | TABLE |
.- Parameters:
schemaName
- schema namepattern
- object name pattern- Returns:
- XMessage
-
buildEnableNotices
-
buildDisableNotices
-
buildListNotices
List the notices the server allows subscribing to. Returns a table as so:| notice (string) | enabled (int) | |---------------------+---------------| | warnings | 1 |
- Returns:
- XMessage
-
buildCreateCollectionIndex
public XMessage buildCreateCollectionIndex(java.lang.String schemaName, java.lang.String collectionName, CreateIndexParams params) -
buildDropCollectionIndex
public XMessage buildDropCollectionIndex(java.lang.String schemaName, java.lang.String collectionName, java.lang.String indexName) -
buildSha256MemoryAuthStart
-
buildSha256MemoryAuthContinue
public XMessage buildSha256MemoryAuthContinue(java.lang.String user, java.lang.String password, byte[] nonce, java.lang.String database) -
buildMysql41AuthStart
-
buildMysql41AuthContinue
public XMessage buildMysql41AuthContinue(java.lang.String user, java.lang.String password, byte[] salt, java.lang.String database) -
buildPlainAuthStart
public XMessage buildPlainAuthStart(java.lang.String user, java.lang.String password, java.lang.String database) -
buildExternalAuthStart
-
buildSessionResetAndClose
-
buildSessionResetKeepOpen
-
buildExpectOpen
-