Package io.undertow.server
Class Connectors
- java.lang.Object
-
- io.undertow.server.Connectors
-
public class Connectors extends Object
This class provides the connector part of theHttpServerExchangeAPI.It contains methods that logically belong on the exchange, however should only be used by connector implementations.
- Author:
- Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description Connectors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidexecuteRootHandler(HttpHandler handler, HttpServerExchange exchange)static voidflattenCookies(HttpServerExchange exchange)Flattens the exchange cookie map into the response header map.static org.xnio.channels.StreamSourceChannelgetExistingRequestChannel(HttpServerExchange exchange)Returns the existing request channel, if it exists.static booleanisEntityBodyAllowed(int code)static booleanisEntityBodyAllowed(HttpServerExchange exchange)static voidresetRequestChannel(HttpServerExchange exchange)static voidsetExchangeRequestPath(HttpServerExchange exchange, String encodedPath, String charset, boolean decode, boolean allowEncodedSlash, StringBuilder decodeBuffer)Sets the request path and query parameters, decoding to the requested charset.static voidsetRequestStartTime(HttpServerExchange exchange)static voidterminateRequest(HttpServerExchange exchange)static voidterminateResponse(HttpServerExchange exchange)static voidungetRequestBytes(HttpServerExchange exchange, PooledByteBuffer... buffers)Attached buffered data to the exchange.static voidupdateResponseBytesSent(HttpServerExchange exchange, long bytes)
-
-
-
Method Detail
-
flattenCookies
public static void flattenCookies(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.- Parameters:
exchange- The server exchange
-
ungetRequestBytes
public static void ungetRequestBytes(HttpServerExchange exchange, PooledByteBuffer... buffers)
Attached buffered data to the exchange. The will generally be used to allow data to be re-read.- Parameters:
exchange- The HTTP server exchangebuffers- The buffers to attach
-
terminateRequest
public static void terminateRequest(HttpServerExchange exchange)
-
terminateResponse
public static void terminateResponse(HttpServerExchange exchange)
-
resetRequestChannel
public static void resetRequestChannel(HttpServerExchange exchange)
-
setRequestStartTime
public static void setRequestStartTime(HttpServerExchange exchange)
-
executeRootHandler
public static void executeRootHandler(HttpHandler handler, HttpServerExchange exchange)
-
setExchangeRequestPath
public static void setExchangeRequestPath(HttpServerExchange exchange, String encodedPath, String charset, boolean decode, boolean allowEncodedSlash, StringBuilder decodeBuffer)
Sets the request path and query parameters, decoding to the requested charset.- Parameters:
exchange- The exchangeencodedPath- The encoded pathcharset- The charset
-
getExistingRequestChannel
public static org.xnio.channels.StreamSourceChannel getExistingRequestChannel(HttpServerExchange exchange)
Returns the existing request channel, if it exists. Otherwise returns null- Parameters:
exchange- The http server exchange
-
isEntityBodyAllowed
public static boolean isEntityBodyAllowed(HttpServerExchange exchange)
-
isEntityBodyAllowed
public static boolean isEntityBodyAllowed(int code)
-
updateResponseBytesSent
public static void updateResponseBytesSent(HttpServerExchange exchange, long bytes)
-
-