public abstract class HttpCommand extends AbstractTextCommand
Modifier and Type | Field and Description |
---|---|
static byte[] |
CONTENT_LENGTH |
static byte[] |
CONTENT_TYPE |
static byte[] |
CONTENT_TYPE_BINARY |
static byte[] |
CONTENT_TYPE_JSON |
static byte[] |
CONTENT_TYPE_PLAIN_TEXT |
static String |
HEADER_CHUNKED |
static String |
HEADER_CONTENT_LENGTH |
static String |
HEADER_CONTENT_TYPE |
static String |
HEADER_CUSTOM_PREFIX |
static String |
HEADER_EXPECT_100 |
protected boolean |
nextLine |
static byte[] |
RES_100 |
static byte[] |
RES_200 |
static byte[] |
RES_204 |
static byte[] |
RES_400 |
static byte[] |
RES_403 |
static byte[] |
RES_404 |
static byte[] |
RES_500 |
static byte[] |
RES_503 |
protected ByteBuffer |
response |
protected String |
uri |
type
Constructor and Description |
---|
HttpCommand(TextCommandConstants.TextCommandType type,
String uri) |
Modifier and Type | Method and Description |
---|---|
String |
getURI() |
boolean |
readFrom(ByteBuffer src) |
void |
send200() |
void |
send204() |
void |
send400() |
void |
setResponse(byte[] value) |
void |
setResponse(byte[] contentType,
byte[] value)
HTTP/1.0 200 OK
Date: Fri, 31 Dec 1999 23:59:59 GMT
Content-TextCommandType: text/html
Content-Length: 1354
|
void |
setResponse(Map<String,Object> headers)
HTTP/1.0 200 OK
Content-Length: 0
Custom-Header1: val1
Custom-Header2: val2
|
boolean |
shouldReply() |
String |
toString() |
boolean |
writeTo(ByteBuffer dst) |
getReadHandler, getRequestId, getType, getWriteHandler, init, isUrgent
public static final String HEADER_CONTENT_TYPE
public static final String HEADER_CONTENT_LENGTH
public static final String HEADER_CHUNKED
public static final String HEADER_EXPECT_100
public static final String HEADER_CUSTOM_PREFIX
public static final byte[] RES_200
public static final byte[] RES_400
public static final byte[] RES_403
public static final byte[] RES_404
public static final byte[] RES_100
public static final byte[] RES_204
public static final byte[] RES_503
public static final byte[] RES_500
public static final byte[] CONTENT_TYPE
public static final byte[] CONTENT_LENGTH
public static final byte[] CONTENT_TYPE_PLAIN_TEXT
public static final byte[] CONTENT_TYPE_JSON
public static final byte[] CONTENT_TYPE_BINARY
protected final String uri
protected ByteBuffer response
protected boolean nextLine
public HttpCommand(TextCommandConstants.TextCommandType type, String uri)
public boolean shouldReply()
shouldReply
in interface TextCommand
shouldReply
in class AbstractTextCommand
public String getURI()
public void send204()
public void send400()
public void setResponse(byte[] value)
public void send200()
public void setResponse(Map<String,Object> headers)
headers
- public void setResponse(byte[] contentType, byte[] value)
contentType
- value
- public boolean writeTo(ByteBuffer dst)
public boolean readFrom(ByteBuffer src)
public String toString()
toString
in class AbstractTextCommand
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.