From 1e3f2aee06a263be25a7e6be0b8cb15a2a4a57eb Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 2 Mar 2023 22:13:45 +0100 Subject: [PATCH] Deprecate callbacks --- src/main/java/io/vertx/core/Context.java | 2 ++ src/main/java/io/vertx/core/Vertx.java | 10 ++++++ .../java/io/vertx/core/WorkerExecutor.java | 3 ++ .../vertx/core/datagram/DatagramSocket.java | 11 ++++++ .../java/io/vertx/core/dns/DnsClient.java | 12 +++++++ .../java/io/vertx/core/eventbus/EventBus.java | 2 ++ .../java/io/vertx/core/eventbus/Message.java | 2 ++ .../vertx/core/eventbus/MessageConsumer.java | 2 ++ .../vertx/core/eventbus/MessageProducer.java | 2 ++ .../java/io/vertx/core/file/AsyncFile.java | 7 ++++ .../io/vertx/core/file/AsyncFileLock.java | 2 ++ .../java/io/vertx/core/file/FileSystem.java | 36 +++++++++++++++++++ .../java/io/vertx/core/http/HttpClient.java | 11 ++++++ .../io/vertx/core/http/HttpClientRequest.java | 13 +++++++ .../vertx/core/http/HttpClientResponse.java | 2 ++ .../io/vertx/core/http/HttpConnection.java | 5 +++ .../java/io/vertx/core/http/HttpServer.java | 6 ++++ .../vertx/core/http/HttpServerFileUpload.java | 1 + .../io/vertx/core/http/HttpServerRequest.java | 3 ++ .../vertx/core/http/HttpServerResponse.java | 17 +++++++++ .../io/vertx/core/http/ServerWebSocket.java | 6 ++++ .../java/io/vertx/core/http/WebSocket.java | 5 +++ .../io/vertx/core/http/WebSocketBase.java | 11 ++++++ .../java/io/vertx/core/net/NetClient.java | 6 ++++ .../java/io/vertx/core/net/NetServer.java | 6 ++++ .../java/io/vertx/core/net/NetSocket.java | 10 ++++++ src/main/java/io/vertx/core/package-info.java | 2 +- .../io/vertx/core/shareddata/AsyncMap.java | 15 ++++++++ .../io/vertx/core/shareddata/Counter.java | 7 ++++ .../io/vertx/core/shareddata/SharedData.java | 9 +++++ src/main/java/io/vertx/core/streams/Pipe.java | 1 + .../io/vertx/core/streams/ReadStream.java | 1 + .../io/vertx/core/streams/WriteStream.java | 3 ++ 33 files changed, 230 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/vertx/core/Context.java b/src/main/java/io/vertx/core/Context.java index f8884827ba9..f4ef3cc8688 100644 --- a/src/main/java/io/vertx/core/Context.java +++ b/src/main/java/io/vertx/core/Context.java @@ -128,6 +128,7 @@ static boolean isOnVertxThread() { * guarantees * @param the type of the result */ + @Deprecated void executeBlocking(Handler> blockingCodeHandler, boolean ordered, Handler> resultHandler); /** @@ -136,6 +137,7 @@ static boolean isOnVertxThread() { * @param resultHandler handler that will be called when the blocking code is complete * @param the type of the result */ + @Deprecated default void executeBlocking(Handler> blockingCodeHandler, Handler> resultHandler) { executeBlocking(blockingCodeHandler, true, resultHandler); } diff --git a/src/main/java/io/vertx/core/Vertx.java b/src/main/java/io/vertx/core/Vertx.java index 3a1ba20d271..8c6bf891caf 100644 --- a/src/main/java/io/vertx/core/Vertx.java +++ b/src/main/java/io/vertx/core/Vertx.java @@ -95,6 +95,7 @@ static Vertx vertx(VertxOptions options) { * @param options the options to use * @param resultHandler the result handler that will receive the result */ + @Deprecated static void clusteredVertx(VertxOptions options, Handler> resultHandler) { new VertxBuilder(options).init().clusteredVertx(resultHandler); } @@ -355,6 +356,7 @@ default TimeoutStream periodicStream(long delay) { * * @param completionHandler The handler will be notified when the close is complete. */ + @Deprecated void close(Handler> completionHandler); /** @@ -384,6 +386,7 @@ default Future deployVerticle(Verticle verticle) { * @param completionHandler a handler which will be notified when the deployment is complete */ @GenIgnore(GenIgnore.PERMITTED_TYPE) + @Deprecated void deployVerticle(Verticle verticle, Handler> completionHandler); /** @@ -428,6 +431,7 @@ default Future deployVerticle(Verticle verticle) { * @param completionHandler a handler which will be notified when the deployment is complete */ @GenIgnore(GenIgnore.PERMITTED_TYPE) + @Deprecated void deployVerticle(Verticle verticle, DeploymentOptions options, Handler> completionHandler); /** @@ -447,6 +451,7 @@ default Future deployVerticle(Verticle verticle) { * Note that the supplier will be invoked on the caller thread. */ @GenIgnore(GenIgnore.PERMITTED_TYPE) + @Deprecated void deployVerticle(Supplier verticleSupplier, DeploymentOptions options, Handler> completionHandler); /** @@ -474,6 +479,7 @@ default Future deployVerticle(String name) { * @param name The identifier * @param completionHandler a handler which will be notified when the deployment is complete */ + @Deprecated default void deployVerticle(String name, Handler> completionHandler) { deployVerticle(name, new DeploymentOptions(), completionHandler); } @@ -497,6 +503,7 @@ default void deployVerticle(String name, Handler> completion * @param options the deployment options. * @param completionHandler a handler which will be notified when the deployment is complete */ + @Deprecated void deployVerticle(String name, DeploymentOptions options, Handler> completionHandler); /** @@ -515,6 +522,7 @@ default void deployVerticle(String name, Handler> completion * @param deploymentID the deployment ID * @param completionHandler a handler which will be notified when the undeployment is complete */ + @Deprecated void undeploy(String deploymentID, Handler> completionHandler); /** @@ -586,6 +594,7 @@ default void deployVerticle(String name, Handler> completion * guarantees * @param the type of the result */ + @Deprecated default void executeBlocking(Handler> blockingCodeHandler, boolean ordered, Handler> resultHandler) { Context context = getOrCreateContext(); context.executeBlocking(blockingCodeHandler, ordered, resultHandler); @@ -594,6 +603,7 @@ default void executeBlocking(Handler> blockingCodeHandler, boolea /** * Like {@link #executeBlocking(Handler, boolean, Handler)} called with ordered = true. */ + @Deprecated default void executeBlocking(Handler> blockingCodeHandler, Handler> resultHandler) { executeBlocking(blockingCodeHandler, true, resultHandler); } diff --git a/src/main/java/io/vertx/core/WorkerExecutor.java b/src/main/java/io/vertx/core/WorkerExecutor.java index 7a4f0827aef..8bcfdf29f24 100644 --- a/src/main/java/io/vertx/core/WorkerExecutor.java +++ b/src/main/java/io/vertx/core/WorkerExecutor.java @@ -48,11 +48,13 @@ public interface WorkerExecutor extends Measured { * guarantees * @param the type of the result */ + @Deprecated void executeBlocking(Handler> blockingCodeHandler, boolean ordered, Handler> resultHandler); /** * Like {@link #executeBlocking(Handler, boolean, Handler)} called with ordered = true. */ + @Deprecated default void executeBlocking(Handler> blockingCodeHandler, Handler> resultHandler) { executeBlocking(blockingCodeHandler, true, resultHandler); } @@ -74,6 +76,7 @@ default Future executeBlocking(Handler> blockingCodeHandler) { * * @param handler the completion handler */ + @Deprecated void close(Handler> handler); /** diff --git a/src/main/java/io/vertx/core/datagram/DatagramSocket.java b/src/main/java/io/vertx/core/datagram/DatagramSocket.java index 5725e823dd0..f3bc0fc03ea 100644 --- a/src/main/java/io/vertx/core/datagram/DatagramSocket.java +++ b/src/main/java/io/vertx/core/datagram/DatagramSocket.java @@ -52,6 +52,7 @@ public interface DatagramSocket extends ReadStream, Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket send(Buffer packet, int port, String host, Handler> handler); /** @@ -80,6 +81,7 @@ public interface DatagramSocket extends ReadStream, Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket send(String str, int port, String host, Handler> handler); /** @@ -99,6 +101,7 @@ public interface DatagramSocket extends ReadStream, Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket send(String str, String enc, int port, String host, Handler> handler); /** @@ -112,6 +115,7 @@ public interface DatagramSocket extends ReadStream, Measured { * * @param handler the handler to notify once complete */ + @Deprecated void close(Handler> handler); /** @@ -137,6 +141,7 @@ public interface DatagramSocket extends ReadStream, Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket listenMulticastGroup(String multicastAddress, Handler> handler); /** @@ -155,6 +160,7 @@ public interface DatagramSocket extends ReadStream, Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket listenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source, Handler> handler); @@ -172,6 +178,7 @@ DatagramSocket listenMulticastGroup(String multicastAddress, String networkInter * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket unlistenMulticastGroup(String multicastAddress, Handler> handler); /** @@ -190,6 +197,7 @@ DatagramSocket listenMulticastGroup(String multicastAddress, String networkInter * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket unlistenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source, Handler> handler); @@ -209,6 +217,7 @@ DatagramSocket unlistenMulticastGroup(String multicastAddress, String networkInt * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket blockMulticastGroup(String multicastAddress, String sourceToBlock, Handler> handler); @@ -229,6 +238,7 @@ DatagramSocket blockMulticastGroup(String multicastAddress, String sourceToBlock * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket blockMulticastGroup(String multicastAddress, String networkInterface, String sourceToBlock, Handler> handler); @@ -246,6 +256,7 @@ DatagramSocket blockMulticastGroup(String multicastAddress, String networkInterf * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DatagramSocket listen(int port, String host, Handler> handler); /** diff --git a/src/main/java/io/vertx/core/dns/DnsClient.java b/src/main/java/io/vertx/core/dns/DnsClient.java index f5af407bd0c..b51c5634340 100644 --- a/src/main/java/io/vertx/core/dns/DnsClient.java +++ b/src/main/java/io/vertx/core/dns/DnsClient.java @@ -40,6 +40,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DnsClient lookup(String name, Handler> handler); /** @@ -57,6 +58,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DnsClient lookup4(String name, Handler> handler); /** @@ -74,6 +76,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DnsClient lookup6(String name, Handler> handler); /** @@ -92,6 +95,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DnsClient resolveA(String name, Handler>> handler); /** @@ -110,6 +114,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated DnsClient resolveAAAA(String name, Handler>> handler); /** @@ -127,6 +132,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently. */ @Fluent + @Deprecated DnsClient resolveCNAME(String name, Handler>> handler); /** @@ -145,6 +151,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently. */ @Fluent + @Deprecated DnsClient resolveMX(String name, Handler>> handler); /** @@ -162,6 +169,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently. */ @Fluent + @Deprecated DnsClient resolveTXT(String name, Handler>> handler); /** @@ -179,6 +187,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently. */ @Fluent + @Deprecated DnsClient resolvePTR(String name, Handler> handler); /** @@ -196,6 +205,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently. */ @Fluent + @Deprecated DnsClient resolveNS(String name, Handler>> handler); /** @@ -213,6 +223,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently. */ @Fluent + @Deprecated DnsClient resolveSRV(String name, Handler>> handler); /** @@ -231,6 +242,7 @@ public interface DnsClient { * @return a reference to this, so the API can be used fluently. */ @Fluent + @Deprecated DnsClient reverseLookup(String ipaddress, Handler> handler); /** diff --git a/src/main/java/io/vertx/core/eventbus/EventBus.java b/src/main/java/io/vertx/core/eventbus/EventBus.java index e4df4fb0e25..c2feee2d103 100644 --- a/src/main/java/io/vertx/core/eventbus/EventBus.java +++ b/src/main/java/io/vertx/core/eventbus/EventBus.java @@ -81,6 +81,7 @@ public interface EventBus extends Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default EventBus request(String address, @Nullable Object message, Handler>> replyHandler) { return request(address, message, new DeliveryOptions(), replyHandler); } @@ -102,6 +103,7 @@ default Future> request(String address, @Nullable Object message) * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default EventBus request(String address, @Nullable Object message, DeliveryOptions options, Handler>> replyHandler) { Future> reply = request(address, message, options); reply.onComplete(replyHandler); diff --git a/src/main/java/io/vertx/core/eventbus/Message.java b/src/main/java/io/vertx/core/eventbus/Message.java index 1538c1b1520..2f2361fe565 100644 --- a/src/main/java/io/vertx/core/eventbus/Message.java +++ b/src/main/java/io/vertx/core/eventbus/Message.java @@ -100,6 +100,7 @@ default void reply(@Nullable Object message) { * @param message the message to reply with. * @param replyHandler the reply handler for the reply. */ + @Deprecated default void replyAndRequest(@Nullable Object message, Handler>> replyHandler) { replyAndRequest(message, new DeliveryOptions(), replyHandler); } @@ -119,6 +120,7 @@ default Future> replyAndRequest(@Nullable Object message) { * @param options delivery options * @param replyHandler reply handler will be called when any reply from the recipient is received */ + @Deprecated default void replyAndRequest(@Nullable Object message, DeliveryOptions options, Handler>> replyHandler) { this.replyAndRequest(message, options).onComplete(replyHandler); } diff --git a/src/main/java/io/vertx/core/eventbus/MessageConsumer.java b/src/main/java/io/vertx/core/eventbus/MessageConsumer.java index e62ad1f9cb0..0482467398e 100644 --- a/src/main/java/io/vertx/core/eventbus/MessageConsumer.java +++ b/src/main/java/io/vertx/core/eventbus/MessageConsumer.java @@ -88,6 +88,7 @@ public interface MessageConsumer extends ReadStream> { * * @param completionHandler the completion handler */ + @Deprecated void completionHandler(Handler> completionHandler); /** @@ -101,5 +102,6 @@ public interface MessageConsumer extends ReadStream> { * @param completionHandler the handler called when the unregister is done. For example in a cluster when all nodes of the * event bus have been unregistered. */ + @Deprecated void unregister(Handler> completionHandler); } diff --git a/src/main/java/io/vertx/core/eventbus/MessageProducer.java b/src/main/java/io/vertx/core/eventbus/MessageProducer.java index e7a07afb378..38d8d1996b0 100644 --- a/src/main/java/io/vertx/core/eventbus/MessageProducer.java +++ b/src/main/java/io/vertx/core/eventbus/MessageProducer.java @@ -49,6 +49,7 @@ public interface MessageProducer { * @param handler the handler called when the message has been successfully or failed to be written, this is not a delivery * guarantee */ + @Deprecated void write(T body, Handler> handler); /** @@ -66,5 +67,6 @@ public interface MessageProducer { /** * Same as {@link #close()} but with an {@code handler} called when the operation completes */ + @Deprecated void close(Handler> handler); } diff --git a/src/main/java/io/vertx/core/file/AsyncFile.java b/src/main/java/io/vertx/core/file/AsyncFile.java index 090d0580efa..6dc0c92619a 100644 --- a/src/main/java/io/vertx/core/file/AsyncFile.java +++ b/src/main/java/io/vertx/core/file/AsyncFile.java @@ -72,6 +72,7 @@ public interface AsyncFile extends ReadStream, WriteStream { * * @param handler the handler */ + @Deprecated void close(Handler> handler); /** @@ -89,6 +90,7 @@ public interface AsyncFile extends ReadStream, WriteStream { * @param position the position in the file to write it at * @param handler the handler to call when the write is complete */ + @Deprecated void write(Buffer buffer, long position, Handler> handler); /** @@ -114,6 +116,7 @@ public interface AsyncFile extends ReadStream, WriteStream { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated AsyncFile read(Buffer buffer, int offset, long position, int length, Handler> handler); /** @@ -136,6 +139,7 @@ public interface AsyncFile extends ReadStream, WriteStream { * Same as {@link #flush} but the handler will be called when the flush is complete or if an error occurs */ @Fluent + @Deprecated AsyncFile flush(Handler> handler); /** @@ -194,6 +198,7 @@ public interface AsyncFile extends ReadStream, WriteStream { /** * Like {@link #size()} but the {@code handler} will be called when the operation is complete or if an error occurs. */ + @Deprecated default void size(Handler> handler) { Future future = size(); if (handler != null) { @@ -237,6 +242,7 @@ default void size(Handler> handler) { * Like {@link #lock()} but the {@code handler} will be called when the operation is complete or if an error occurs. */ @Unstable + @Deprecated void lock(Handler> handler); /** @@ -254,6 +260,7 @@ default void size(Handler> handler) { * Like {@link #lock(long, long, boolean)} but the {@code handler} will be called when the operation is complete or if an error occurs. */ @Unstable + @Deprecated void lock(long position, long size, boolean shared, Handler> handler); } diff --git a/src/main/java/io/vertx/core/file/AsyncFileLock.java b/src/main/java/io/vertx/core/file/AsyncFileLock.java index 3e2ba0712a1..57bf52e03c3 100644 --- a/src/main/java/io/vertx/core/file/AsyncFileLock.java +++ b/src/main/java/io/vertx/core/file/AsyncFileLock.java @@ -57,6 +57,7 @@ public interface AsyncFileLock { /** * Like {@link #isValid()} but the {@code handler} will be called when the operation completes or if an error occurs. */ + @Deprecated void isValid(Handler> handler); /** @@ -74,5 +75,6 @@ public interface AsyncFileLock { /** * Like {@link #release()} but the {@code handler} will be called when the operation completes or if an error occurs. */ + @Deprecated void release(Handler> handler); } diff --git a/src/main/java/io/vertx/core/file/FileSystem.java b/src/main/java/io/vertx/core/file/FileSystem.java index bfb0aa0363c..50a4ff781f3 100644 --- a/src/main/java/io/vertx/core/file/FileSystem.java +++ b/src/main/java/io/vertx/core/file/FileSystem.java @@ -52,6 +52,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem copy(String from, String to, Handler> handler); /** @@ -69,6 +70,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem copy(String from, String to, CopyOptions options, Handler> handler); /** @@ -97,6 +99,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem copyRecursive(String from, String to, boolean recursive, Handler> handler); /** @@ -121,6 +124,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem move(String from, String to, Handler> handler); /** @@ -138,6 +142,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem move(String from, String to, CopyOptions options, Handler> handler); /** @@ -162,6 +167,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem truncate(String path, long len, Handler> handler); /** @@ -187,6 +193,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem chmod(String path, String perms, Handler> handler); /** @@ -215,6 +222,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem chmodRecursive(String path, String perms, String dirPerms, Handler> handler); /** @@ -239,6 +247,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem chown(String path, @Nullable String user, @Nullable String group, Handler> handler); /** @@ -263,6 +272,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem props(String path, Handler> handler); /** @@ -285,6 +295,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem lprops(String path, Handler> handler); /** @@ -306,6 +317,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem link(String link, String existing, Handler> handler); /** @@ -328,6 +340,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem symlink(String link, String existing, Handler> handler); /** @@ -349,6 +362,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem unlink(String link, Handler> handler); /** @@ -370,6 +384,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem readSymlink(String link, Handler> handler); /** @@ -390,6 +405,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem delete(String path, Handler> handler); /** @@ -415,6 +431,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem deleteRecursive(String path, boolean recursive, Handler> handler); /** @@ -438,6 +455,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem mkdir(String path, Handler> handler); /** @@ -467,6 +485,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem mkdir(String path, String perms, Handler> handler); /** @@ -490,6 +509,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem mkdirs(String path, Handler> handler); /** @@ -519,6 +539,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem mkdirs(String path, String perms, Handler> handler); /** @@ -542,6 +563,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem readDir(String path, Handler>> handler); /** @@ -568,6 +590,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem readDir(String path, String filter, Handler>> handler); /** @@ -590,6 +613,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem readFile(String path, Handler> handler); /** @@ -611,6 +635,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem writeFile(String path, Buffer data, Handler> handler); /** @@ -635,6 +660,7 @@ public interface FileSystem { * */ @Fluent + @Deprecated FileSystem open(String path, OpenOptions options, Handler> handler); /** @@ -655,6 +681,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createFile(String path, Handler> handler); /** @@ -677,6 +704,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createFile(String path, String perms, Handler> handler); /** @@ -698,6 +726,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem exists(String path, Handler> handler); /** @@ -718,6 +747,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem fsProps(String path, Handler> handler); /** @@ -746,6 +776,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createTempDirectory(String prefix, Handler> handler); /** @@ -780,6 +811,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createTempDirectory(String prefix, String perms, Handler> handler); /** @@ -815,6 +847,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createTempDirectory(String dir, String prefix, String perms, Handler> handler); /** @@ -846,6 +879,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createTempFile(String prefix, String suffix, Handler> handler); /** @@ -876,6 +910,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createTempFile(String prefix, String suffix, String perms, Handler> handler); /** @@ -913,6 +948,7 @@ public interface FileSystem { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated FileSystem createTempFile(String dir, String prefix, String suffix, String perms, Handler> handler); /** diff --git a/src/main/java/io/vertx/core/http/HttpClient.java b/src/main/java/io/vertx/core/http/HttpClient.java index 96de2928cbc..9f96c76c5db 100644 --- a/src/main/java/io/vertx/core/http/HttpClient.java +++ b/src/main/java/io/vertx/core/http/HttpClient.java @@ -66,6 +66,7 @@ public interface HttpClient extends Measured { * @param options the request options * @param handler the handler called when the request is ready to be sent */ + @Deprecated void request(RequestOptions options, Handler> handler); /** @@ -83,6 +84,7 @@ public interface HttpClient extends Measured { * @param requestURI the relative URI * @param handler the handler called when the request is ready to be sent */ + @Deprecated void request(HttpMethod method, int port, String host, String requestURI, Handler> handler); /** @@ -99,6 +101,7 @@ public interface HttpClient extends Measured { * @param requestURI the relative URI * @param handler the handler called when the request is ready to be sent */ + @Deprecated void request(HttpMethod method, String host, String requestURI, Handler> handler); /** @@ -114,6 +117,7 @@ public interface HttpClient extends Measured { * @param requestURI the relative URI * @param handler the handler called when the request is ready to be sent */ + @Deprecated void request(HttpMethod method, String requestURI, Handler> handler); /** @@ -128,6 +132,7 @@ public interface HttpClient extends Measured { * @param requestURI the relative URI * @param handler handler that will be called with the WebSocket when connected */ + @Deprecated void webSocket(int port, String host, String requestURI, Handler> handler); /** @@ -141,6 +146,7 @@ public interface HttpClient extends Measured { * @param requestURI the relative URI * @param handler handler that will be called with the WebSocket when connected */ + @Deprecated void webSocket(String host, String requestURI, Handler> handler); /** @@ -153,6 +159,7 @@ public interface HttpClient extends Measured { * @param requestURI the relative URI * @param handler handler that will be called with the WebSocket when connected */ + @Deprecated void webSocket(String requestURI, Handler> handler); /** @@ -165,6 +172,7 @@ public interface HttpClient extends Measured { * * @param options the request options */ + @Deprecated void webSocket(WebSocketConnectOptions options, Handler> handler); /** @@ -182,6 +190,7 @@ public interface HttpClient extends Measured { * @param subProtocols the subprotocols to use * @param handler handler that will be called if WebSocket connection fails */ + @Deprecated void webSocketAbs(String url, MultiMap headers, WebsocketVersion version, List subProtocols, Handler> handler); /** @@ -206,6 +215,7 @@ public interface HttpClient extends Measured { * @param options the new SSL options * @param handler the update handler */ + @Deprecated default void updateSSLOptions(SSLOptions options, Handler> handler) { Future fut = updateSSLOptions(options); if (handler != null) { @@ -253,6 +263,7 @@ default void updateSSLOptions(SSLOptions options, Handler> han * Close the client. Closing will close down any pooled connections. * Clients should always be closed after use. */ + @Deprecated void close(Handler> handler); /** diff --git a/src/main/java/io/vertx/core/http/HttpClientRequest.java b/src/main/java/io/vertx/core/http/HttpClientRequest.java index c289c06a945..a5bf8ee349a 100644 --- a/src/main/java/io/vertx/core/http/HttpClientRequest.java +++ b/src/main/java/io/vertx/core/http/HttpClientRequest.java @@ -229,6 +229,7 @@ public interface HttpClientRequest extends WriteStream { /** * Same as {@link #write(String)} but with an {@code handler} called when the operation completes */ + @Deprecated void write(String chunk, Handler> handler); /** @@ -244,6 +245,7 @@ public interface HttpClientRequest extends WriteStream { /** * Same as {@link #write(String,String)} but with an {@code handler} called when the operation completes */ + @Deprecated void write(String chunk, String enc, Handler> handler); /** @@ -285,6 +287,7 @@ public interface HttpClientRequest extends WriteStream { * the {@link HttpVersion} if it can be determined or null otherwise.

*/ @Fluent + @Deprecated HttpClientRequest sendHead(Handler> completionHandler); /** @@ -307,6 +310,7 @@ public interface HttpClientRequest extends WriteStream { * * @param handler the response completion handler */ + @Deprecated void connect(Handler> handler); /** @@ -323,6 +327,7 @@ public interface HttpClientRequest extends WriteStream { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated HttpClientRequest response(Handler> handler); /** @@ -335,6 +340,7 @@ public interface HttpClientRequest extends WriteStream { * * @param handler the completion handler for the {@link HttpClientResponse} */ + @Deprecated default void send(Handler> handler) { response(handler); end(); @@ -353,6 +359,7 @@ default Future send() { * * @param handler the completion handler for the {@link HttpClientResponse} */ + @Deprecated default void send(String body, Handler> handler) { response(handler); end(body); @@ -371,6 +378,7 @@ default Future send(String body) { * * @param handler the completion handler for the {@link HttpClientResponse} */ + @Deprecated default void send(Buffer body, Handler> handler) { response(handler); end(body); @@ -392,6 +400,7 @@ default Future send(Buffer body) { * * @param handler the completion handler for the {@link HttpClientResponse} */ + @Deprecated default void send(ReadStream body, Handler> handler) { MultiMap headers = headers(); if (headers == null || !headers.contains(HttpHeaders.CONTENT_LENGTH)) { @@ -425,6 +434,7 @@ default Future send(ReadStream body) { /** * Same as {@link #end(String)} but with an {@code handler} called when the operation completes */ + @Deprecated void end(String chunk, Handler> handler); /** @@ -440,6 +450,7 @@ default Future send(ReadStream body) { /** * Same as {@link #end(String,String)} but with an {@code handler} called when the operation completes */ + @Deprecated void end(String chunk, String enc, Handler> handler); /** @@ -456,6 +467,7 @@ default Future send(ReadStream body) { * Same as {@link #end(String)} but with an {@code handler} called when the operation completes */ @Override + @Deprecated void end(Buffer chunk, Handler> handler); /** @@ -474,6 +486,7 @@ default Future send(ReadStream body) { * Same as {@link #end()} but with an {@code handler} called when the operation completes */ @Override + @Deprecated void end(Handler> handler); /** diff --git a/src/main/java/io/vertx/core/http/HttpClientResponse.java b/src/main/java/io/vertx/core/http/HttpClientResponse.java index 7df3cc99b84..d41aa229ec2 100644 --- a/src/main/java/io/vertx/core/http/HttpClientResponse.java +++ b/src/main/java/io/vertx/core/http/HttpClientResponse.java @@ -137,6 +137,7 @@ default HttpClientResponse bodyHandler(Handler bodyHandler) { * Same as {@link #body()} but with an {@code handler} called when the operation completes */ @Fluent + @Deprecated default HttpClientResponse body(Handler> handler) { Future fut = body(); fut.onComplete(handler); @@ -156,6 +157,7 @@ default HttpClientResponse body(Handler> handler) { /** * Same as {@link #end()} but with an {@code handler} called when the operation completes */ + @Deprecated default void end(Handler> handler) { end().onComplete(handler); } diff --git a/src/main/java/io/vertx/core/http/HttpConnection.java b/src/main/java/io/vertx/core/http/HttpConnection.java index c3fbf548b29..6c81c87e6a5 100644 --- a/src/main/java/io/vertx/core/http/HttpConnection.java +++ b/src/main/java/io/vertx/core/http/HttpConnection.java @@ -131,6 +131,7 @@ default HttpConnection goAway(long errorCode, int lastStreamId) { * * @param handler the handler called when shutdown has completed */ + @Deprecated default void shutdown(Handler> handler) { shutdown(30000, handler); } @@ -145,6 +146,7 @@ default Future shutdown() { /** * Like {@link #shutdown(Handler)} but with a specific {@code timeout} in milliseconds. */ + @Deprecated void shutdown(long timeout, Handler> handler); /** @@ -173,6 +175,7 @@ default Future shutdown() { * * @param handler the handler to be completed when the connection is closed */ + @Deprecated default void close(Handler> handler) { close().onComplete(handler); } @@ -204,6 +207,7 @@ default void close(Handler> handler) { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated HttpConnection updateSettings(Http2Settings settings, Handler> completionHandler); /** @@ -232,6 +236,7 @@ default void close(Handler> handler) { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated HttpConnection ping(Buffer data, Handler> pongHandler); /** diff --git a/src/main/java/io/vertx/core/http/HttpServer.java b/src/main/java/io/vertx/core/http/HttpServer.java index accf7aa5619..83067097be1 100644 --- a/src/main/java/io/vertx/core/http/HttpServer.java +++ b/src/main/java/io/vertx/core/http/HttpServer.java @@ -137,6 +137,7 @@ public interface HttpServer extends Measured { * @param options the new SSL options * @param handler the update handler */ + @Deprecated default void updateSSLOptions(SSLOptions options, Handler> handler) { Future fut = updateSSLOptions(options); if (handler != null) { @@ -178,6 +179,7 @@ default Future listen(int port, String host) { * @param listenHandler the listen handler */ @Fluent + @Deprecated default HttpServer listen(int port, String host, Handler> listenHandler) { Future fut = listen(port, host); if (listenHandler != null) { @@ -195,6 +197,7 @@ default HttpServer listen(int port, String host, Handler * @param listenHandler the listen handler */ @Fluent + @Deprecated default HttpServer listen(SocketAddress address, Handler> listenHandler) { Future fut = listen(address); if (listenHandler != null) { @@ -227,6 +230,7 @@ default Future listen(int port) { * @param listenHandler the listen handler */ @Fluent + @Deprecated default HttpServer listen(int port, Handler> listenHandler) { Future fut = listen(port); if (listenHandler != null) { @@ -241,6 +245,7 @@ default HttpServer listen(int port, Handler> listenHandl * @param listenHandler the listen handler */ @Fluent + @Deprecated default HttpServer listen(Handler> listenHandler) { Future fut = listen(); if (listenHandler != null) { @@ -263,6 +268,7 @@ default HttpServer listen(Handler> listenHandler) { * * @param completionHandler the handler */ + @Deprecated void close(Handler> completionHandler); /** diff --git a/src/main/java/io/vertx/core/http/HttpServerFileUpload.java b/src/main/java/io/vertx/core/http/HttpServerFileUpload.java index afa0bf94158..61134678546 100644 --- a/src/main/java/io/vertx/core/http/HttpServerFileUpload.java +++ b/src/main/java/io/vertx/core/http/HttpServerFileUpload.java @@ -51,6 +51,7 @@ public interface HttpServerFileUpload extends ReadStream { * * @param filename the name of the file */ + @Deprecated void streamToFileSystem(String filename, Handler> handler); /** diff --git a/src/main/java/io/vertx/core/http/HttpServerRequest.java b/src/main/java/io/vertx/core/http/HttpServerRequest.java index cb4d01cecc6..2b974e7c31f 100644 --- a/src/main/java/io/vertx/core/http/HttpServerRequest.java +++ b/src/main/java/io/vertx/core/http/HttpServerRequest.java @@ -307,6 +307,7 @@ default HttpServerRequest body(Handler> handler) { /** * Same as {@link #end()} but with an {@code handler} called when the operation completes */ + @Deprecated default void end(Handler> handler) { end().onComplete(handler); } @@ -342,6 +343,7 @@ default void end(Handler> handler) { * * @param handler the completion handler */ + @Deprecated default void toNetSocket(Handler> handler) { Future fut = toNetSocket(); if (handler != null) { @@ -424,6 +426,7 @@ default int streamId() { * * @param handler the completion handler */ + @Deprecated default void toWebSocket(Handler> handler) { Future fut = toWebSocket(); if (handler != null) { diff --git a/src/main/java/io/vertx/core/http/HttpServerResponse.java b/src/main/java/io/vertx/core/http/HttpServerResponse.java index 6282694d6b8..1bcd6fb6e69 100644 --- a/src/main/java/io/vertx/core/http/HttpServerResponse.java +++ b/src/main/java/io/vertx/core/http/HttpServerResponse.java @@ -218,6 +218,7 @@ public interface HttpServerResponse extends WriteStream { /** * Same as {@link #write(String, String)} but with an {@code handler} called when the operation completes */ + @Deprecated void write(String chunk, String enc, Handler> handler); /** @@ -231,6 +232,7 @@ public interface HttpServerResponse extends WriteStream { /** * Same as {@link #write(String)} but with an {@code handler} called when the operation completes */ + @Deprecated void write(String chunk, Handler> handler); /** @@ -254,6 +256,7 @@ public interface HttpServerResponse extends WriteStream { * * @param headers headers to write */ + @Deprecated void writeEarlyHints(MultiMap headers, Handler> handler); /** @@ -267,6 +270,7 @@ public interface HttpServerResponse extends WriteStream { /** * Same as {@link #end(String)} but with an {@code handler} called when the operation completes */ + @Deprecated void end(String chunk, Handler> handler); /** @@ -281,6 +285,7 @@ public interface HttpServerResponse extends WriteStream { /** * Same as {@link #end(String, String)} but with an {@code handler} called when the operation completes */ + @Deprecated void end(String chunk, String enc, Handler> handler); /** @@ -297,6 +302,7 @@ public interface HttpServerResponse extends WriteStream { * Same as {@link #end(Buffer)} but with an {@code handler} called when the operation completes */ @Override + @Deprecated void end(Buffer chunk, Handler> handler); /** @@ -315,6 +321,7 @@ public interface HttpServerResponse extends WriteStream { * * @param handler the completion handler */ + @Deprecated default void send(Handler> handler) { end(handler); } @@ -331,6 +338,7 @@ default Future send() { * * @param handler the completion handler */ + @Deprecated default void send(String body, Handler> handler) { end(body, handler); } @@ -347,6 +355,7 @@ default Future send(String body) { * * @param handler the completion handler */ + @Deprecated default void send(Buffer body, Handler> handler) { end(body, handler); } @@ -366,6 +375,7 @@ default Future send(Buffer body) { * * @param handler the completion handler */ + @Deprecated default void send(ReadStream body, Handler> handler) { MultiMap headers = headers(); if (headers == null || !headers.contains(HttpHeaders.CONTENT_LENGTH)) { @@ -430,6 +440,7 @@ default Future sendFile(String filename, long offset) { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default HttpServerResponse sendFile(String filename, Handler> resultHandler) { return sendFile(filename, 0, resultHandler); } @@ -444,6 +455,7 @@ default HttpServerResponse sendFile(String filename, Handler> * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default HttpServerResponse sendFile(String filename, long offset, Handler> resultHandler) { return sendFile(filename, offset, Long.MAX_VALUE, resultHandler); } @@ -459,6 +471,7 @@ default HttpServerResponse sendFile(String filename, long offset, Handler> resultHandler); /** @@ -517,6 +530,7 @@ default HttpServerResponse sendFile(String filename, long offset, Handler> handler) { return push(method, host, path, null, handler); } @@ -532,6 +546,7 @@ default Future push(HttpMethod method, String host, String p * Like {@link #push(HttpMethod, String, String, MultiMap, Handler)} with the host copied from the current request. */ @Fluent + @Deprecated default HttpServerResponse push(HttpMethod method, String path, MultiMap headers, Handler> handler) { return push(method, null, path, headers, handler); } @@ -547,6 +562,7 @@ default Future push(HttpMethod method, String path, MultiMap * Like {@link #push(HttpMethod, String, String, MultiMap, Handler)} with the host copied from the current request. */ @Fluent + @Deprecated default HttpServerResponse push(HttpMethod method, String path, Handler> handler) { return push(method, null, path, null, handler); } @@ -577,6 +593,7 @@ default Future push(HttpMethod method, String path) { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default HttpServerResponse push(HttpMethod method, String host, String path, MultiMap headers, Handler> handler) { Future fut = push(method, host, path, headers); if (handler != null) { diff --git a/src/main/java/io/vertx/core/http/ServerWebSocket.java b/src/main/java/io/vertx/core/http/ServerWebSocket.java index 2ba848058bb..76c507f40dd 100644 --- a/src/main/java/io/vertx/core/http/ServerWebSocket.java +++ b/src/main/java/io/vertx/core/http/ServerWebSocket.java @@ -60,18 +60,23 @@ public interface ServerWebSocket extends WebSocketBase { ServerWebSocket drainHandler(Handler handler); @Override + @Deprecated ServerWebSocket writeFrame(WebSocketFrame frame, Handler> handler); @Override + @Deprecated ServerWebSocket writeFinalTextFrame(String text, Handler> handler); @Override + @Deprecated ServerWebSocket writeFinalBinaryFrame(Buffer data, Handler> handler); @Override + @Deprecated ServerWebSocket writeBinaryMessage(Buffer data, Handler> handler); @Override + @Deprecated ServerWebSocket writeTextMessage(String text, Handler> handler); @Override @@ -158,6 +163,7 @@ public interface ServerWebSocket extends WebSocketBase { * @param handler the completion handler * @throws IllegalStateException when the WebSocket has already an asynchronous result */ + @Deprecated void setHandshake(Future future, Handler> handler); /** diff --git a/src/main/java/io/vertx/core/http/WebSocket.java b/src/main/java/io/vertx/core/http/WebSocket.java index 887d5e950e6..4e8e4f4e1d8 100644 --- a/src/main/java/io/vertx/core/http/WebSocket.java +++ b/src/main/java/io/vertx/core/http/WebSocket.java @@ -49,18 +49,23 @@ public interface WebSocket extends WebSocketBase { WebSocket drainHandler(Handler handler); @Override + @Deprecated WebSocket writeFrame(WebSocketFrame frame, Handler> handler); @Override + @Deprecated WebSocket writeFinalTextFrame(String text, Handler> handler); @Override + @Deprecated WebSocket writeFinalBinaryFrame(Buffer data, Handler> handler); @Override + @Deprecated WebSocket writeBinaryMessage(Buffer data, Handler> handler); @Override + @Deprecated WebSocket writeTextMessage(String text, Handler> handler); @Override diff --git a/src/main/java/io/vertx/core/http/WebSocketBase.java b/src/main/java/io/vertx/core/http/WebSocketBase.java index fee45fd0313..bafd397841b 100644 --- a/src/main/java/io/vertx/core/http/WebSocketBase.java +++ b/src/main/java/io/vertx/core/http/WebSocketBase.java @@ -137,6 +137,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * Same as {@link #writeFrame(WebSocketFrame)} but with an {@code handler} called when the operation completes */ @Fluent + @Deprecated WebSocketBase writeFrame(WebSocketFrame frame, Handler> handler); /** @@ -151,6 +152,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * Same as {@link #writeFinalTextFrame(String, Handler)} but with an {@code handler} called when the operation completes */ @Fluent + @Deprecated WebSocketBase writeFinalTextFrame(String text, Handler> handler); /** @@ -165,6 +167,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * Same as {@link #writeFinalBinaryFrame(Buffer, Handler)} but with an {@code handler} called when the operation completes */ @Fluent + @Deprecated WebSocketBase writeFinalBinaryFrame(Buffer data, Handler> handler); /** @@ -180,6 +183,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * Same as {@link #writeBinaryMessage(Buffer)} but with an {@code handler} called when the operation completes */ @Fluent + @Deprecated WebSocketBase writeBinaryMessage(Buffer data, Handler> handler); /** @@ -195,6 +199,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * Same as {@link #writeTextMessage(String)} but with an {@code handler} called when the operation completes */ @Fluent + @Deprecated WebSocketBase writeTextMessage(String text, Handler> handler); /** @@ -210,6 +215,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * @param handler called when the ping frame has been successfully written * @return a reference to this, so the API can be used fluently */ + @Deprecated @Fluent WebSocketBase writePing(Buffer data, Handler> handler); @@ -234,6 +240,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated WebSocketBase writePong(Buffer data, Handler> handler); /** @@ -315,6 +322,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { * Calls {@link #close(Handler)} */ @Override + @Deprecated void end(Handler> handler); /** @@ -329,6 +337,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { /** * Same as {@link #close()} but with an {@code handler} called when the operation completes */ + @Deprecated void close(Handler> handler); /** @@ -345,6 +354,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { /** * Same as {@link #close(short)} but with an {@code handler} called when the operation completes */ + @Deprecated void close(short statusCode, Handler> handler); /** @@ -362,6 +372,7 @@ public interface WebSocketBase extends ReadStream, WriteStream { /** * Same as {@link #close(short, String)} but with an {@code handler} called when the operation completes */ + @Deprecated void close(short statusCode, @Nullable String reason, Handler> handler); /** diff --git a/src/main/java/io/vertx/core/net/NetClient.java b/src/main/java/io/vertx/core/net/NetClient.java index 1e31a0e68f5..bebfd3990a3 100644 --- a/src/main/java/io/vertx/core/net/NetClient.java +++ b/src/main/java/io/vertx/core/net/NetClient.java @@ -42,6 +42,7 @@ public interface NetClient extends Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated NetClient connect(int port, String host, Handler> connectHandler); /** @@ -61,6 +62,7 @@ public interface NetClient extends Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated NetClient connect(int port, String host, String serverName, Handler> connectHandler); /** @@ -77,6 +79,7 @@ public interface NetClient extends Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated NetClient connect(SocketAddress remoteAddress, Handler> connectHandler); /** @@ -94,6 +97,7 @@ public interface NetClient extends Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated NetClient connect(SocketAddress remoteAddress, String serverName, Handler> connectHandler); /** @@ -107,6 +111,7 @@ public interface NetClient extends Measured { * Any sockets which have not been closed manually will be closed here. The close is asynchronous and may not * complete until some time after the method has returned. */ + @Deprecated void close(Handler> handler); /** @@ -131,6 +136,7 @@ public interface NetClient extends Measured { * @param options the new SSL options * @param handler the update handler */ + @Deprecated default void updateSSLOptions(SSLOptions options, Handler> handler) { Future fut = updateSSLOptions(options); if (handler != null) { diff --git a/src/main/java/io/vertx/core/net/NetServer.java b/src/main/java/io/vertx/core/net/NetServer.java index 85c133696ad..dc33bf5f305 100644 --- a/src/main/java/io/vertx/core/net/NetServer.java +++ b/src/main/java/io/vertx/core/net/NetServer.java @@ -68,6 +68,7 @@ public interface NetServer extends Measured { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default NetServer listen(Handler> listenHandler) { Future fut = listen(); if (listenHandler != null) { @@ -102,6 +103,7 @@ default Future listen(int port, String host) { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default NetServer listen(int port, String host, Handler> listenHandler) { Future fut = listen(port, host); if (listenHandler != null) { @@ -132,6 +134,7 @@ default Future listen(int port) { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default NetServer listen(int port, Handler> listenHandler) { return listen(port, "0.0.0.0", listenHandler); } @@ -155,6 +158,7 @@ default NetServer listen(int port, Handler> listenHandler * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default NetServer listen(SocketAddress localAddress, Handler> listenHandler) { Future fut = listen(localAddress); if (listenHandler != null) { @@ -187,6 +191,7 @@ default NetServer listen(SocketAddress localAddress, Handler> completionHandler); /** @@ -214,6 +219,7 @@ default NetServer listen(SocketAddress localAddress, Handler> handler) { Future fut = updateSSLOptions(options); if (handler != null) { diff --git a/src/main/java/io/vertx/core/net/NetSocket.java b/src/main/java/io/vertx/core/net/NetSocket.java index 9c57ade5ee1..aed0450186f 100644 --- a/src/main/java/io/vertx/core/net/NetSocket.java +++ b/src/main/java/io/vertx/core/net/NetSocket.java @@ -94,6 +94,7 @@ public interface NetSocket extends ReadStream, WriteStream { /** * Same as {@link #write(String)} but with an {@code handler} called when the operation completes */ + @Deprecated void write(String str, Handler> handler); /** @@ -107,6 +108,7 @@ public interface NetSocket extends ReadStream, WriteStream { /** * Same as {@link #write(String, String)} but with an {@code handler} called when the operation completes */ + @Deprecated void write(String str, String enc, Handler> handler); /** @@ -122,6 +124,7 @@ public interface NetSocket extends ReadStream, WriteStream { * Like {@link #write(Object)} but with an {@code handler} called when the message has been written * or failed to be written. */ + @Deprecated void write(Buffer message, Handler> handler); /** @@ -167,6 +170,7 @@ default Future sendFile(String filename, long offset) { * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default NetSocket sendFile(String filename, Handler> resultHandler) { return sendFile(filename, 0, Long.MAX_VALUE, resultHandler); } @@ -181,6 +185,7 @@ default NetSocket sendFile(String filename, Handler> resultHan * @return a reference to this, so the API can be used fluently */ @Fluent + @Deprecated default NetSocket sendFile(String filename, long offset, Handler> resultHandler) { return sendFile(filename, offset, Long.MAX_VALUE, resultHandler); } @@ -196,6 +201,7 @@ default NetSocket sendFile(String filename, long offset, Handler> resultHandler); /** @@ -234,6 +240,7 @@ default NetSocket sendFile(String filename, long offset, Handler> handler); /** @@ -246,6 +253,7 @@ default NetSocket sendFile(String filename, long offset, Handler> handler); /** @@ -264,6 +272,7 @@ default NetSocket sendFile(String filename, long offset, Handler> handler); /** @@ -279,6 +288,7 @@ default NetSocket sendFile(String filename, long offset, Handler> handler); /** diff --git a/src/main/java/io/vertx/core/package-info.java b/src/main/java/io/vertx/core/package-info.java index 22eb66fcd55..65ba2324ccb 100644 --- a/src/main/java/io/vertx/core/package-info.java +++ b/src/main/java/io/vertx/core/package-info.java @@ -9,5 +9,5 @@ * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 */ -@io.vertx.codegen.annotations.ModuleGen(name = "vertx", groupPackage = "io.vertx") +@io.vertx.codegen.annotations.ModuleGen(name = "vertx", groupPackage = "io.vertx", checkCallbackDeprecation = true) package io.vertx.core; diff --git a/src/main/java/io/vertx/core/shareddata/AsyncMap.java b/src/main/java/io/vertx/core/shareddata/AsyncMap.java index c317ec36a06..0d2034c9bd2 100644 --- a/src/main/java/io/vertx/core/shareddata/AsyncMap.java +++ b/src/main/java/io/vertx/core/shareddata/AsyncMap.java @@ -42,6 +42,7 @@ public interface AsyncMap { * @param k the key * @param resultHandler - this will be called some time later with the async result. */ + @Deprecated default void get(K k, Handler> resultHandler) { get(k).onComplete(resultHandler); } @@ -58,6 +59,7 @@ default void get(K k, Handler> resultHandler) { * @param v the value * @param completionHandler - this will be called some time later to signify the value has been put */ + @Deprecated default void put(K k, V v, Handler> completionHandler) { put(k, v).onComplete(completionHandler); } @@ -76,6 +78,7 @@ default void put(K k, V v, Handler> completionHandler) { * @param ttl The time to live (in ms) for the entry * @param completionHandler the handler */ + @Deprecated default void put(K k, V v, long ttl, Handler> completionHandler) { put(k, v, ttl).onComplete(completionHandler); } @@ -93,6 +96,7 @@ default void put(K k, V v, long ttl, Handler> completionHandle * @param v the value * @param completionHandler the handler */ + @Deprecated default void putIfAbsent(K k, V v, Handler> completionHandler) { putIfAbsent(k, v).onComplete(completionHandler); } @@ -111,6 +115,7 @@ default void putIfAbsent(K k, V v, Handler> completionH * @param ttl The time to live (in ms) for the entry * @param completionHandler the handler */ + @Deprecated default void putIfAbsent(K k, V v, long ttl, Handler> completionHandler) { putIfAbsent(k, v, ttl).onComplete(completionHandler); } @@ -126,6 +131,7 @@ default void putIfAbsent(K k, V v, long ttl, Handler> c * @param k the key * @param resultHandler - this will be called some time later to signify the value has been removed */ + @Deprecated default void remove(K k, Handler> resultHandler) { remove(k).onComplete(resultHandler); } @@ -142,6 +148,7 @@ default void remove(K k, Handler> resultHandler) { * @param v the value * @param resultHandler - this will be called some time later to signify the value has been removed */ + @Deprecated default void removeIfPresent(K k, V v, Handler> resultHandler) { removeIfPresent(k, v).onComplete(resultHandler); } @@ -158,6 +165,7 @@ default void removeIfPresent(K k, V v, Handler> resultHandl * @param v the new value * @param resultHandler the result handler will be passed the previous value */ + @Deprecated default void replace(K k, V v, Handler> resultHandler) { replace(k, v).onComplete(resultHandler); } @@ -175,6 +183,7 @@ default void replace(K k, V v, Handler> resultHandler) * @param ttl The time to live (in ms) for the entry * @param resultHandler the result handler will be passed the previous value */ + @Deprecated default void replace(K k, V v, long ttl, Handler> resultHandler) { replace(k, v, ttl).onComplete(resultHandler); } @@ -196,6 +205,7 @@ default void replace(K k, V v, long ttl, Handler> resul * @param newValue the new value * @param resultHandler the result handler */ + @Deprecated default void replaceIfPresent(K k, V oldValue, V newValue, Handler> resultHandler) { replaceIfPresent(k, oldValue, newValue).onComplete(resultHandler); } @@ -214,6 +224,7 @@ default void replaceIfPresent(K k, V oldValue, V newValue, Handler> resultHandler) { replaceIfPresent(k, oldValue, newValue, ttl).onComplete(resultHandler); } @@ -232,6 +243,7 @@ default Future replaceIfPresent(K k, V oldValue, V newValue, long ttl) * * @param resultHandler called on completion */ + @Deprecated default void clear(Handler> resultHandler) { clear().onComplete(resultHandler); } @@ -246,6 +258,7 @@ default void clear(Handler> resultHandler) { * * @param resultHandler handler which will receive the number of entries */ + @Deprecated default void size(Handler> resultHandler) { size().onComplete(resultHandler); } @@ -265,6 +278,7 @@ default void size(Handler> resultHandler) { * @param resultHandler invoked when the operation completes */ @GenIgnore(PERMITTED_TYPE) + @Deprecated default void keys(Handler>> resultHandler) { keys().onComplete(resultHandler); } @@ -285,6 +299,7 @@ default void keys(Handler>> resultHandler) { * @param resultHandler invoked when the operation completes */ @GenIgnore(PERMITTED_TYPE) + @Deprecated default void values(Handler>> resultHandler) { values().onComplete(resultHandler); } diff --git a/src/main/java/io/vertx/core/shareddata/Counter.java b/src/main/java/io/vertx/core/shareddata/Counter.java index 857eaf3e4e8..a369b7f9a21 100644 --- a/src/main/java/io/vertx/core/shareddata/Counter.java +++ b/src/main/java/io/vertx/core/shareddata/Counter.java @@ -33,6 +33,7 @@ public interface Counter { * * @param resultHandler handler which will be passed the value */ + @Deprecated default void get(Handler> resultHandler) { Objects.requireNonNull(resultHandler, "resultHandler"); get().onComplete(resultHandler); @@ -48,6 +49,7 @@ default void get(Handler> resultHandler) { * * @param resultHandler handler which will be passed the value */ + @Deprecated default void incrementAndGet(Handler> resultHandler) { Objects.requireNonNull(resultHandler, "resultHandler"); incrementAndGet().onComplete(resultHandler); @@ -63,6 +65,7 @@ default void incrementAndGet(Handler> resultHandler) { * * @param resultHandler handler which will be passed the value */ + @Deprecated default void getAndIncrement(Handler> resultHandler) { Objects.requireNonNull(resultHandler, "resultHandler"); getAndIncrement().onComplete(resultHandler); @@ -78,6 +81,7 @@ default void getAndIncrement(Handler> resultHandler) { * * @param resultHandler handler which will be passed the value */ + @Deprecated default void decrementAndGet(Handler> resultHandler) { Objects.requireNonNull(resultHandler, "resultHandler"); decrementAndGet().onComplete(resultHandler); @@ -94,6 +98,7 @@ default void decrementAndGet(Handler> resultHandler) { * @param value the value to add * @param resultHandler handler which will be passed the value */ + @Deprecated default void addAndGet(long value, Handler> resultHandler) { Objects.requireNonNull(resultHandler, "resultHandler"); addAndGet(value).onComplete(resultHandler); @@ -110,6 +115,7 @@ default void addAndGet(long value, Handler> resultHandler) { * @param value the value to add * @param resultHandler handler which will be passed the value */ + @Deprecated default void getAndAdd(long value, Handler> resultHandler) { Objects.requireNonNull(resultHandler, "resultHandler"); getAndAdd(value).onComplete(resultHandler); @@ -128,6 +134,7 @@ default void getAndAdd(long value, Handler> resultHandler) { * @param value the new value * @param resultHandler the handler will be passed true on success */ + @Deprecated default void compareAndSet(long expected, long value, Handler> resultHandler) { Objects.requireNonNull(resultHandler, "resultHandler"); compareAndSet(expected, value).onComplete(resultHandler); diff --git a/src/main/java/io/vertx/core/shareddata/SharedData.java b/src/main/java/io/vertx/core/shareddata/SharedData.java index 56c620922ef..b9bedfeed8c 100644 --- a/src/main/java/io/vertx/core/shareddata/SharedData.java +++ b/src/main/java/io/vertx/core/shareddata/SharedData.java @@ -46,6 +46,7 @@ public interface SharedData { * @param resultHandler the map will be returned asynchronously in this handler * @throws IllegalStateException if the parent {@link io.vertx.core.Vertx} instance is not clustered */ + @Deprecated void getClusterWideMap(String name, Handler>> resultHandler); /** @@ -64,6 +65,7 @@ public interface SharedData { * @param name the name of the map * @param resultHandler the map will be returned asynchronously in this handler */ + @Deprecated void getAsyncMap(String name, Handler>> resultHandler); /** @@ -80,6 +82,7 @@ public interface SharedData { * @param name the name of the map * @param resultHandler the map will be returned asynchronously in this handler */ + @Deprecated void getLocalAsyncMap(String name, Handler>> resultHandler); /** @@ -97,6 +100,7 @@ public interface SharedData { * @param name the name of the lock * @param resultHandler the handler */ + @Deprecated void getLock(String name, Handler> resultHandler); /** @@ -116,6 +120,7 @@ public interface SharedData { * @param timeout the timeout in ms * @param resultHandler the handler */ + @Deprecated void getLockWithTimeout(String name, long timeout, Handler> resultHandler); /** @@ -133,6 +138,7 @@ public interface SharedData { * @param name the name of the lock * @param resultHandler the handler */ + @Deprecated void getLocalLock(String name, Handler> resultHandler); /** @@ -152,6 +158,7 @@ public interface SharedData { * @param timeout the timeout in ms * @param resultHandler the handler */ + @Deprecated void getLocalLockWithTimeout(String name, long timeout, Handler> resultHandler); /** @@ -165,6 +172,7 @@ public interface SharedData { * @param name the name of the counter. * @param resultHandler the handler */ + @Deprecated void getCounter(String name, Handler> resultHandler); /** @@ -178,6 +186,7 @@ public interface SharedData { * @param name the name of the counter. * @param resultHandler the handler */ + @Deprecated void getLocalCounter(String name, Handler> resultHandler); /** diff --git a/src/main/java/io/vertx/core/streams/Pipe.java b/src/main/java/io/vertx/core/streams/Pipe.java index fe0124936c2..9e4092dfdd0 100644 --- a/src/main/java/io/vertx/core/streams/Pipe.java +++ b/src/main/java/io/vertx/core/streams/Pipe.java @@ -87,6 +87,7 @@ default Future to(WriteStream dst) { * @param dst the destination write stream * @param completionHandler the handler called when the pipe operation completes */ + @Deprecated void to(WriteStream dst, Handler> completionHandler); /** diff --git a/src/main/java/io/vertx/core/streams/ReadStream.java b/src/main/java/io/vertx/core/streams/ReadStream.java index 6ea543d1329..9e5eb6aa82f 100644 --- a/src/main/java/io/vertx/core/streams/ReadStream.java +++ b/src/main/java/io/vertx/core/streams/ReadStream.java @@ -130,6 +130,7 @@ default Future pipeTo(WriteStream dst) { * * @param dst the destination write stream */ + @Deprecated default void pipeTo(WriteStream dst, Handler> handler) { new PipeImpl<>(this).to(dst, handler); } diff --git a/src/main/java/io/vertx/core/streams/WriteStream.java b/src/main/java/io/vertx/core/streams/WriteStream.java index 210b8ee7fcd..8ac81b4fcd1 100644 --- a/src/main/java/io/vertx/core/streams/WriteStream.java +++ b/src/main/java/io/vertx/core/streams/WriteStream.java @@ -61,6 +61,7 @@ public interface WriteStream extends StreamBase { /** * Same as {@link #write(T)} but with an {@code handler} called when the operation completes */ + @Deprecated void write(T data, Handler> handler); /** @@ -79,6 +80,7 @@ default Future end() { /** * Same as {@link #end()} but with an {@code handler} called when the operation completes */ + @Deprecated void end(Handler> handler); /** @@ -98,6 +100,7 @@ default Future end(T data) { /** * Same as {@link #end(T)} but with an {@code handler} called when the operation completes */ + @Deprecated default void end(T data, Handler> handler) { if (handler != null) { write(data, ar -> {