HttpServerExchange API.
It contains methods that logically belong on the exchange, however should only be used by connector implementations.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean[] | |
| private static final boolean[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | addCookie(final HttpServerExchange
The server exchange exchange, Cookie The cookie cookie)Adds the cookie into the response header map. |
| private static String | |
| private static String | |
| private static String | |
| public static boolean | areRequestHeadersValid(HeaderMap headers)
Verifies that the provided request headers are valid according to rfc7230. |
| public static void | |
| public static void | flattenCookies(final HttpServerExchange
The server exchange exchange)Flattens the exchange cookie map into the response header map. |
| public static ConduitStreamSinkChannel | |
| private static String | |
| public static StreamSourceChannel | getExistingRequestChannel(final HttpServerExchange
The http server exchange exchange)Returns the existing request channel, if it exists. |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static void | |
| public static void | setExchangeRequestPath(final HttpServerExchange
The exchange exchange, final String The encoded path encodedPath, final String The charset charset, boolean decode, final boolean allowEncodedSlash, StringBuilder decodeBuffer)
Deprecated
Sets the request path and query parameters, decoding to the requested charset. |
| public static void | setExchangeRequestPath(final HttpServerExchange
The exchange exchange, final String The encoded path to decode encodedPath, StringBuilder The decode buffer to use decodeBuffer)Sets the request path and query parameters, decoding to the requested charset. |
| public static void | setExchangeRequestPath(final HttpServerExchange
The exchange exchange, final String The encoded path encodedPath, final String The charset charset, boolean decode, final boolean decodeSlashFlag, StringBuilder decodeBuffer, int maxParameters)Sets the request path and query parameters, decoding to the requested charset. |
| public static void | |
| public static void | |
| public static void | |
| public static void | |
| public static void | ungetRequestBytes(final HttpServerExchange
The HTTP server exchange exchange, PooledByteBuffer... The buffers to attach buffers)Attached buffered data to the exchange. |
| public static void | |
| public static void | verifyToken(HttpString
The header to verify header)Verifies that the contents of the HttpString are a valid token according to rfc7230. |
| ALLOWED_SCHEME_CHARACTERS | back to summary |
|---|---|
| private static final boolean[] ALLOWED_SCHEME_CHARACTERS | |
| ALLOWED_TOKEN_CHARACTERS | back to summary |
|---|---|
| private static final boolean[] ALLOWED_TOKEN_CHARACTERS | |
| Connectors | back to summary |
|---|---|
| public Connectors() | |
| addCookie | back to summary |
|---|---|
| public static void addCookie(final HttpServerExchange exchange, Cookie cookie) Adds the cookie into the response header map. This should be called before the response is started.
| |
| addRfc6265ResponseCookieToExchange | back to summary |
|---|---|
| private static String addRfc6265ResponseCookieToExchange(final Cookie cookie) | |
| addVersion0ResponseCookieToExchange | back to summary |
|---|---|
| private static String addVersion0ResponseCookieToExchange(final Cookie cookie) | |
| addVersion1ResponseCookieToExchange | back to summary |
|---|---|
| private static String addVersion1ResponseCookieToExchange(final Cookie cookie) | |
| areRequestHeadersValid | back to summary |
|---|---|
| public static boolean areRequestHeadersValid(HeaderMap headers) Verifies that the provided request headers are valid according to rfc7230. In particular: - At most one content-length or transfer encoding | |
| executeRootHandler | back to summary |
|---|---|
| public static void executeRootHandler(final HttpHandler handler, final HttpServerExchange exchange) | |
| flattenCookies | back to summary |
|---|---|
| public static void flattenCookies(final HttpServerExchange exchange) Flattens the exchange cookie map into the response header map. This should be called by a connector just before the response is started.
| |
| getConduitSinkChannel | back to summary |
|---|---|
| public static ConduitStreamSinkChannel getConduitSinkChannel(HttpServerExchange exchange) | |
| getCookieString | back to summary |
|---|---|
| private static String getCookieString(final Cookie cookie, boolean enableRfc6265Validation) | |
| getExistingRequestChannel | back to summary |
|---|---|
| public static StreamSourceChannel getExistingRequestChannel(final HttpServerExchange exchange) Returns the existing request channel, if it exists. Otherwise returns null
| |
| isEntityBodyAllowed | back to summary |
|---|---|
| public static boolean isEntityBodyAllowed(HttpServerExchange exchange) | |
| isEntityBodyAllowed | back to summary |
|---|---|
| public static boolean isEntityBodyAllowed(int code) | |
| isValidSchemeCharacter | back to summary |
|---|---|
| public static boolean isValidSchemeCharacter(byte c) | |
| isValidTokenCharacter | back to summary |
|---|---|
| public static boolean isValidTokenCharacter(byte c) Returns true if the token character is valid according to rfc7230 | |
| resetRequestChannel | back to summary |
|---|---|
| public static void resetRequestChannel(final HttpServerExchange exchange) | |
| setExchangeRequestPath | back to summary |
|---|---|
| public static void setExchangeRequestPath(final HttpServerExchange exchange, final String encodedPath, final String charset, boolean decode, final boolean allowEncodedSlash, StringBuilder decodeBuffer)
Deprecated
Sets the request path and query parameters, decoding to the requested charset.
| |
| setExchangeRequestPath | back to summary |
|---|---|
| public static void setExchangeRequestPath(final HttpServerExchange exchange, final String encodedPath, StringBuilder decodeBuffer) throws ParameterLimitException Sets the request path and query parameters, decoding to the requested charset. All the options are retrieved from the exchange undertow options.
| |
| setExchangeRequestPath | back to summary |
|---|---|
| public static void setExchangeRequestPath(final HttpServerExchange exchange, final String encodedPath, final String charset, boolean decode, final boolean decodeSlashFlag, StringBuilder decodeBuffer, int maxParameters) throws ParameterLimitException Sets the request path and query parameters, decoding to the requested charset.
| |
| setRequestStartTime | back to summary |
|---|---|
| public static void setRequestStartTime(HttpServerExchange exchange) | |
| setRequestStartTime | back to summary |
|---|---|
| public static void setRequestStartTime(HttpServerExchange existing, HttpServerExchange newExchange) | |
| terminateRequest | back to summary |
|---|---|
| public static void terminateRequest(final HttpServerExchange exchange) | |
| terminateResponse | back to summary |
|---|---|
| public static void terminateResponse(final HttpServerExchange exchange) | |
| ungetRequestBytes | back to summary |
|---|---|
| public static void ungetRequestBytes(final HttpServerExchange exchange, PooledByteBuffer... buffers) Attached buffered data to the exchange. The will generally be used to allow data to be re-read.
| |
| updateResponseBytesSent | back to summary |
|---|---|
| public static void updateResponseBytesSent(HttpServerExchange exchange, long bytes) | |
| verifyToken | back to summary |
|---|---|
| public static void verifyToken(HttpString header) Verifies that the contents of the HttpString are a valid token according to rfc7230.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Connectors. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | exchangeEvent(HttpServerExchange exchange, ExchangeCompletionListener.
Implements io.
|
| public static Connectors. | |
| public static Connectors. |
| INSTANCE | back to summary |
|---|---|
| public static final Connectors. | |
| BufferedRequestDataCleanupListener | back to summary |
|---|---|
| private BufferedRequestDataCleanupListener() | |
| exchangeEvent | back to summary |
|---|---|
| public void exchangeEvent(HttpServerExchange exchange, ExchangeCompletionListener. Implements io.
| |
| valueOf | back to summary |
|---|---|
| public static Connectors. | |
| values | back to summary |
|---|---|
| public static Connectors. | |