/** * Set a text message handler on the connection. This handler will be called similar to the * {@link #binaryMessageHandler(Handler)}, but the buffer will be converted to a String first * * @param handler the handler * @return a reference to this, so the API can be used fluently */ @Fluent WebSocketBase textMessageHandler(@Nullable Handler<String> handler);
/** * Set a binary message handler on the connection. This handler serves a similar purpose to {@link #handler(Handler)} * except that if a message comes into the socket in multiple frames, the data from the frames will be aggregated * into a single buffer before calling the handler (using {@link WebSocketFrame#isFinal()} to find the boundaries). * * @param handler the handler * @return a reference to this, so the API can be used fluently */ @Fluent WebSocketBase binaryMessageHandler(@Nullable Handler<Buffer> handler);
/** * Set an exception handler called when the context runs an action throwing an uncaught throwable.<p/> * * When this handler is called, {@link Vertx#currentContext()} will return this context. * * @param handler the exception handler * @return a reference to this, so the API can be used fluently */ @Fluent Context exceptionHandler(@Nullable Handler<Throwable> handler);
/** * Try to lookup the A (ipv4) or AAAA (ipv6) record for the given name. The first found will be used. * * @param name the name to resolve * @param handler the {@link io.vertx.core.Handler} to notify with the {@link io.vertx.core.AsyncResult}. * The handler will get notified with the resolved address if a record was found. If non was found it * will get notifed with {@code null}. If an error accours it will get failed. * @return a reference to this, so the API can be used fluently */ @Fluent DnsClient lookup(String name, Handler<AsyncResult<@Nullable String>> handler);
/** * Try to lookup the A (ipv4) record for the given name. The first found will be used. * * @param name the name to resolve * @param handler the {@link Handler} to notify with the {@link io.vertx.core.AsyncResult}. * The handler will get notified with the resolved {@link java.net.Inet4Address} if a record was found. * If non was found it will get notifed with {@code null}. If an error accours it will get failed. * @return a reference to this, so the API can be used fluently */ @Fluent DnsClient lookup4(String name, Handler<AsyncResult<@Nullable String>> handler);
/** * Try to resolve the PTR record for the given name. * * @param name the name to resolve the PTR for * @param handler the {@link Handler} to notify with the {@link AsyncResult}. The handler will get * notified with the resolved {@link String} if a record was found. If none was found it will * get notified with {@code null}. If an error accours it will get failed. * @return a reference to this, so the API can be used fluently. */ @Fluent DnsClient resolvePTR(String name, Handler<AsyncResult<@Nullable String>> handler);
/** * Sets values for the specified name. * * @param name The name of the headers being set * @param values The values of the headers being set * @return a reference to this, so the API can be used fluently */ @GenIgnore(GenIgnore.PERMITTED_TYPE) @Fluent MultiMap set(String name, Iterable<String> values);
/** * Transfers the content of the Buffer starting at position {@code start} and ending at position {@code end - 1} * into a {@code byte[]} at the specific destination. * * @param dst the destination byte array * @throws IndexOutOfBoundsException if the content of the Buffer cannot fit into the destination byte array */ @GenIgnore(GenIgnore.PERMITTED_TYPE) @Fluent Buffer getBytes(int start, int end, byte[] dst, int dstIndex);