| Modifier and Type | Field and Description |
|---|---|
static String |
INVALID_COMMAND_MESSAGE |
static String |
SERVER_ERROR_MESSAGE |
| Constructor and Description |
|---|
HttpEventTask(Socket socket) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected static void |
parseParams(String queryString,
CommandRequest request)
Consume all the body submitted and parse params into
CommandRequest |
protected static Map<String,String> |
parsePostHeaders(InputStream in)
Process header line in request
|
protected static void |
parseSingleParam(String single,
CommandRequest request) |
protected static void |
processPostRequest(InputStream in,
CommandRequest request)
Try to process the body of POST request additionally.
|
protected static CommandRequest |
processQueryString(String line)
Parse raw HTTP request line to a
CommandRequest. |
protected static String |
removeAnchor(String str)
Truncate query from "a=1&b=2#mark" to "a=1&b=2"
|
void |
run() |
public static final String SERVER_ERROR_MESSAGE
public static final String INVALID_COMMAND_MESSAGE
public HttpEventTask(Socket socket)
protected static void processPostRequest(InputStream in, CommandRequest request) throws RequestException, IOException
in - request - RequestExceptionIOExceptionprotected static Map<String,String> parsePostHeaders(InputStream in) throws IOException
in - IOExceptionprotected static void parseParams(String queryString, CommandRequest request)
CommandRequestqueryString - request - protected static CommandRequest processQueryString(String line)
CommandRequest.line - HTTP request lineprotected static String removeAnchor(String str)
str - protected static void parseSingleParam(String single, CommandRequest request)
Copyright © 2020 Alibaba Group. All rights reserved.