public abstract class HttpCommand extends AbstractTextCommand
TextCommandConstants.TextCommandType
Modifier and Type | Field and Description |
---|---|
static byte[] |
CONTENT_LENGTH |
static byte[] |
CONTENT_TYPE |
static byte[] |
CONTENT_TYPE_BINARY |
static byte[] |
CONTENT_TYPE_PLAIN_TEXT |
static String |
HEADER_CHUNKED |
static String |
HEADER_CONTENT_LENGTH |
static String |
HEADER_CONTENT_TYPE |
static String |
HEADER_EXPECT_100 |
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
CLIENT_ERROR, DELETED, END, ERROR, FLAG_ZERO, MONTH_SECONDS, NOT_FOUND, NOT_STORED, RETURN, RETURN_END, SERVER_ERROR, SPACE, STORED, TOUCHED, VALUE_SPACE
Constructor and Description |
---|
HttpCommand(TextCommandConstants.TextCommandType type,
String uri) |
Modifier and Type | Method and Description |
---|---|
String |
getURI() |
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
|
boolean |
shouldReply() |
String |
toString() |
boolean |
writeTo(ByteBuffer bb)
Asks the SocketWritable to write its content to the destination ByteBuffer.
|
getRequestId, getSocketTextReader, getSocketTextWriter, getType, init, isUrgent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
readFrom
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
protected final String uri
protected ByteBuffer response
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_BINARY
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(byte[] contentType, byte[] value)
contentType
- value
- public boolean writeTo(ByteBuffer bb)
SocketWritable
bb
- the ByteBuffer to write to.public String toString()
toString
in class AbstractTextCommand
Copyright © 2014 Hazelcast, Inc.. All rights reserved.