public class Connectors extends Object
HttpServerExchange
API.
It contains methods that logically belong on the exchange, however should only be used by connector implementations.
Constructor and Description |
---|
Connectors() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areRequestHeadersValid(HeaderMap headers)
Verifies that the provided request headers are valid according to rfc7230.
|
static void |
executeRootHandler(HttpHandler handler,
HttpServerExchange exchange) |
static void |
flattenCookies(HttpServerExchange exchange)
Flattens the exchange cookie map into the response header map.
|
static ConduitStreamSinkChannel |
getConduitSinkChannel(HttpServerExchange exchange) |
static StreamSourceChannel |
getExistingRequestChannel(HttpServerExchange exchange)
Returns the existing request channel, if it exists.
|
static boolean |
isEntityBodyAllowed(HttpServerExchange exchange) |
static boolean |
isEntityBodyAllowed(int code) |
static boolean |
isValidTokenCharacter(byte c)
Returns true if the token character is valid according to rfc7230
|
static void |
resetRequestChannel(HttpServerExchange exchange) |
static void |
setExchangeRequestPath(HttpServerExchange exchange,
String encodedPath,
String charset,
boolean decode,
boolean allowEncodedSlash,
StringBuilder decodeBuffer)
Deprecated.
|
static void |
setExchangeRequestPath(HttpServerExchange exchange,
String encodedPath,
String charset,
boolean decode,
boolean allowEncodedSlash,
StringBuilder decodeBuffer,
int maxParameters)
Sets the request path and query parameters, decoding to the requested charset.
|
static void |
setRequestStartTime(HttpServerExchange exchange) |
static void |
terminateRequest(HttpServerExchange exchange) |
static void |
terminateResponse(HttpServerExchange exchange) |
static void |
ungetRequestBytes(HttpServerExchange exchange,
PooledByteBuffer... buffers)
Attached buffered data to the exchange.
|
static void |
updateResponseBytesSent(HttpServerExchange exchange,
long bytes) |
static void |
verifyToken(HttpString header)
Verifies that the contents of the HttpString are a valid token according to rfc7230.
|
public static void flattenCookies(HttpServerExchange exchange)
exchange
- The server exchangepublic static void ungetRequestBytes(HttpServerExchange exchange, PooledByteBuffer... buffers)
exchange
- The HTTP server exchangebuffers
- The buffers to attachpublic static void terminateRequest(HttpServerExchange exchange)
public static void terminateResponse(HttpServerExchange exchange)
public static void resetRequestChannel(HttpServerExchange exchange)
public static void setRequestStartTime(HttpServerExchange exchange)
public static void executeRootHandler(HttpHandler handler, HttpServerExchange exchange)
@Deprecated public static void setExchangeRequestPath(HttpServerExchange exchange, String encodedPath, String charset, boolean decode, boolean allowEncodedSlash, StringBuilder decodeBuffer)
exchange
- The exchangeencodedPath
- The encoded pathcharset
- The charsetpublic static void setExchangeRequestPath(HttpServerExchange exchange, String encodedPath, String charset, boolean decode, boolean allowEncodedSlash, StringBuilder decodeBuffer, int maxParameters) throws ParameterLimitException
exchange
- The exchangeencodedPath
- The encoded pathcharset
- The charsetParameterLimitException
public static StreamSourceChannel getExistingRequestChannel(HttpServerExchange exchange)
exchange
- The http server exchangepublic static boolean isEntityBodyAllowed(HttpServerExchange exchange)
public static boolean isEntityBodyAllowed(int code)
public static void updateResponseBytesSent(HttpServerExchange exchange, long bytes)
public static ConduitStreamSinkChannel getConduitSinkChannel(HttpServerExchange exchange)
public static void verifyToken(HttpString header)
header
- The header to verifypublic static boolean isValidTokenCharacter(byte c)
public static boolean areRequestHeadersValid(HeaderMap headers)
Copyright © 2017 JBoss by Red Hat. All rights reserved.