/** * Returns the value of with the specified name. If there are * more than one values for the specified name, the first value is returned. * * @param name The name of the header to search * @return The first header value or {@code null} if there is no such entry */ @Nullable String get(String name);
/** * Gets an {@link Argument} based on its name (argument name). * * @param name the name of the argument, must not be {@code null} * @return the {@link Argument}, {@code null} if not found. */ @Nullable Argument getArgument(String name);
/** * Get a value from the map, asynchronously. * * @param k the key * @param resultHandler - this will be called some time later with the async result. */ void get(K k, Handler<AsyncResult<@Nullable V>> resultHandler);
/** * Link {@link #putIfAbsent} but specifying a time to live for the entry. Entry will expire and get evicted * after the ttl. * * @param k the key * @param v the value * @param ttl The time to live (in ms) for the entry * @param completionHandler the handler */ void putIfAbsent(K k, V v, long ttl, Handler<AsyncResult<@Nullable V>> completionHandler);
/** * Replace the entry only if it is currently mapped to some value * * @param k the key * @param v the new value * @param resultHandler the result handler will be passed the previous value */ void replace(K k, V v, Handler<AsyncResult<@Nullable V>> resultHandler);
@Override public HttpServerResponse bodyEndHandler(@Nullable Handler<Void> handler) { synchronized (conn) { bodyEndHandler = handler; return this; } }
/** * The reply address. Can be null. * * @return the reply address, or null, if message was sent without a reply handler. */ @Nullable String replyAddress();
/** * Gets the raw value of the given option. Raw values are the values as given in the user command line. * * @param option the option * @return the value, {@code null} if none. */ @Nullable String getRawValueForOption(Option option);
/** * Gets the raw value of the given argument. Raw values are the values as given in the user command line. * * @param arg the argument * @return the value, {@code null} if none. */ @Nullable String getRawValueForArgument(Argument arg);
/** * Gets an {@link Argument} based on its index. * * @param index the index, must be positive or zero. * @return the {@link Argument}, {@code null} if not found. */ @Nullable Argument getArgument(int index);
/** * Return the first param value with the specified name * * @param paramName the param name * @return the param value */ @Nullable String getParam(String paramName);
/** * Gets the value of an argument with the matching name (arg name). * * @param name the name * @param <T> the expected type * @return the value, {@code null} if not set */ @Nullable <T> T getArgumentValue(String name);
@Override public HttpConnection pingHandler(@Nullable Handler<Buffer> handler) { throw new UnsupportedOperationException("HTTP/1.x connections don't support PING"); } }
/** * Change the ownership on the file represented by {@code path} to {@code user} and {code group}, asynchronously. * * @param path the path to the file * @param user the user name, {@code null} will not change the user name * @param group the user group, {@code null} will not change the user group name * @param handler the handler that will be called on completion * @return a reference to this, so the API can be used fluently */ @Fluent FileSystem chown(String path, @Nullable String user, @Nullable String group, Handler<AsyncResult<Void>> handler);
/** * Like {@link #executeBlocking(Handler, boolean, Handler)} called with ordered = true. */ default <T> void executeBlocking(Handler<Future<T>> blockingCodeHandler, Handler<AsyncResult<@Nullable T>> resultHandler) { executeBlocking(blockingCodeHandler, true, resultHandler); }
/** * Gets the current context * * @return The current context or null if no current context */ static @Nullable Context currentContext() { return factory.context(); }
/** * 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);
@Override public HttpConnection goAwayHandler(@Nullable Handler<GoAway> handler) { if (current instanceof Http1xClientConnection) { goAwayHandler = handler; } else { current.goAwayHandler(handler); } return this; }