1313
1414import io .vertx .codegen .annotations .Fluent ;
1515import io .vertx .codegen .annotations .VertxGen ;
16- import io .vertx .core .AsyncResult ;
1716import io .vertx .core .Future ;
1817import io .vertx .core .Handler ;
1918import io .vertx .core .Vertx ;
2019import io .vertx .core .impl .ContextInternal ;
2120import io .vertx .mysqlclient .impl .MySQLConnectionImpl ;
22- import io .vertx .sqlclient .PreparedStatement ;
2321import io .vertx .sqlclient .SqlConnection ;
2422
2523import static io .vertx .mysqlclient .MySQLConnectOptions .fromUri ;
4240 */
4341@ VertxGen
4442public interface MySQLConnection extends SqlConnection {
43+
4544 /**
4645 * Create a connection to MySQL server with the given {@code connectOptions}.
4746 *
4847 * @param vertx the vertx instance
4948 * @param connectOptions the options for the connection
50- * @param handler the handler called with the connection or the failure
51- */
52- @ Deprecated
53- static void connect (Vertx vertx , MySQLConnectOptions connectOptions , Handler <AsyncResult <MySQLConnection >> handler ) {
54- Future <MySQLConnection > fut = connect (vertx , connectOptions );
55- if (handler != null ) {
56- fut .onComplete (handler );
57- }
58- }
59-
60- /**
61- * Like {@link #connect(Vertx, MySQLConnectOptions, Handler)} but returns a {@code Future} of the asynchronous result
49+ * @return a future notified with the connection or the failure
6250 */
6351 static Future <MySQLConnection > connect (Vertx vertx , MySQLConnectOptions connectOptions ) {
6452 return MySQLConnectionImpl .connect ((ContextInternal ) vertx .getOrCreateContext (), connectOptions );
6553 }
6654
6755 /**
68- * Like {@link #connect(Vertx, MySQLConnectOptions, Handler)} with options built from {@code connectionUri}.
69- */
70- @ Deprecated
71- static void connect (Vertx vertx , String connectionUri , Handler <AsyncResult <MySQLConnection >> handler ) {
72- connect (vertx , fromUri (connectionUri ), handler );
73- }
74-
75- /**
76- * Like {@link #connect(Vertx, String, Handler)} but returns a {@code Future} of the asynchronous result
56+ * Like {@link #connect(Vertx, MySQLConnectOptions)} with options built from {@code connectionUri}.
7757 */
7858 static Future <MySQLConnection > connect (Vertx vertx , String connectionUri ) {
7959 return connect (vertx , fromUri (connectionUri ));
8060 }
8161
82- /**
83- * {@inheritDoc}
84- */
85- @ Fluent
86- @ Override
87- @ Deprecated
88- MySQLConnection prepare (String sql , Handler <AsyncResult <PreparedStatement >> handler );
89-
9062 /**
9163 * {@inheritDoc}
9264 */
@@ -104,46 +76,22 @@ static Future<MySQLConnection> connect(Vertx vertx, String connectionUri) {
10476 /**
10577 * Send a PING command to check if the server is alive.
10678 *
107- * @param handler the handler notified when the server responses to client
108- * @return a reference to this, so the API can be used fluently
109- */
110- @ Fluent
111- @ Deprecated
112- MySQLConnection ping (Handler <AsyncResult <Void >> handler );
113-
114- /**
115- * Like {@link #ping(Handler)} but returns a {@code Future} of the asynchronous result
79+ * @return a future notified with the server response
11680 */
11781 Future <Void > ping ();
11882
11983 /**
12084 * Send a INIT_DB command to change the default schema of the connection.
12185 *
12286 * @param schemaName name of the schema to change to
123- * @param handler the handler notified with the execution result
124- * @return a reference to this, so the API can be used fluently
125- */
126- @ Fluent
127- @ Deprecated
128- MySQLConnection specifySchema (String schemaName , Handler <AsyncResult <Void >> handler );
129-
130- /**
131- * Like {@link #specifySchema(String, Handler)} but returns a {@code Future} of the asynchronous result
87+ * @return a future notified with the execution result
13288 */
13389 Future <Void > specifySchema (String schemaName );
13490
13591 /**
13692 * Send a STATISTICS command to get a human readable string of the server internal status.
13793 *
138- * @param handler the handler notified with the execution result
139- * @return a reference to this, so the API can be used fluently
140- */
141- @ Fluent
142- @ Deprecated
143- MySQLConnection getInternalStatistics (Handler <AsyncResult <String >> handler );
144-
145- /**
146- * Like {@link #getInternalStatistics(Handler)} but returns a {@code Future} of the asynchronous result
94+ * @return a future notified with the execution result
14795 */
14896 Future <String > getInternalStatistics ();
14997
@@ -152,61 +100,28 @@ static Future<MySQLConnection> connect(Vertx vertx, String connectionUri) {
152100 * Send a SET_OPTION command to set options for the current connection.
153101 *
154102 * @param option the options to set
155- * @param handler the handler notified with the execution result
156- * @return a reference to this, so the API can be used fluently
157- */
158- @ Fluent
159- @ Deprecated
160- MySQLConnection setOption (MySQLSetOption option , Handler <AsyncResult <Void >> handler );
161-
162- /**
163- * Like {@link #setOption(MySQLSetOption, Handler)} but returns a {@code Future} of the asynchronous result
103+ * @return a future notified with the execution result
164104 */
165105 Future <Void > setOption (MySQLSetOption option );
166106
167107 /**
168108 * Send a RESET_CONNECTION command to reset the session state.
169109 *
170- * @param handler the handler notified with the execution result
171- * @return a reference to this, so the API can be used fluently
172- */
173- @ Fluent
174- @ Deprecated
175- MySQLConnection resetConnection (Handler <AsyncResult <Void >> handler );
176-
177- /**
178- * Like {@link #resetConnection(Handler)} but returns a {@code Future} of the asynchronous result
110+ * @return a future notified with the execution result
179111 */
180112 Future <Void > resetConnection ();
181113
182114 /**
183115 * Send a DEBUG command to dump debug information to the server's stdout.
184116 *
185- * @param handler the handler notified with the execution result
186- * @return a reference to this, so the API can be used fluently
187- */
188- @ Fluent
189- @ Deprecated
190- MySQLConnection debug (Handler <AsyncResult <Void >> handler );
191-
192- /**
193- * Like {@link #debug(Handler)} but returns a {@code Future} of the asynchronous result
117+ * @return a future notified with the execution result
194118 */
195119 Future <Void > debug ();
196120
197121 /**
198122 * Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
199123 *
200- * @param options authentication options
201- * @param handler the handler
202- * @return a reference to this, so the API can be used fluently
203- */
204- @ Fluent
205- @ Deprecated
206- MySQLConnection changeUser (MySQLAuthOptions options , Handler <AsyncResult <Void >> handler );
207-
208- /**
209- * Like {@link #changeUser(MySQLAuthOptions, Handler)} but returns a {@code Future} of the asynchronous result
124+ * @return a future notified with the execution result
210125 */
211126 Future <Void > changeUser (MySQLAuthOptions options );
212127
0 commit comments