com.hazelcast.ascii.rest
Class HttpCommand
java.lang.Object
com.hazelcast.ascii.AbstractTextCommand
com.hazelcast.ascii.rest.HttpCommand
- All Implemented Interfaces:
- TextCommand, SocketReadable, SocketWritable
- Direct Known Subclasses:
- HttpDeleteCommand, HttpGetCommand, HttpPostCommand
public abstract class HttpCommand
- extends AbstractTextCommand
HEADER_CONTENT_TYPE
public static final String HEADER_CONTENT_TYPE
- See Also:
- Constant Field Values
HEADER_CONTENT_LENGTH
public static final String HEADER_CONTENT_LENGTH
- See Also:
- Constant Field Values
HEADER_CHUNKED
public static final String HEADER_CHUNKED
- See Also:
- Constant Field Values
HEADER_EXPECT_100
public static final String HEADER_EXPECT_100
- See Also:
- Constant Field Values
RES_200
public static final byte[] RES_200
RES_400
public static final byte[] RES_400
RES_403
public static final byte[] RES_403
RES_404
public static final byte[] RES_404
RES_100
public static final byte[] RES_100
RES_204
public static final byte[] RES_204
RES_503
public static final byte[] RES_503
RES_500
public static final byte[] RES_500
CONTENT_TYPE
public static final byte[] CONTENT_TYPE
CONTENT_LENGTH
public static final byte[] CONTENT_LENGTH
CONTENT_TYPE_PLAIN_TEXT
public static final byte[] CONTENT_TYPE_PLAIN_TEXT
CONTENT_TYPE_BINARY
public static final byte[] CONTENT_TYPE_BINARY
uri
protected final String uri
response
protected ByteBuffer response
HttpCommand
public HttpCommand(TextCommandConstants.TextCommandType type,
String uri)
shouldReply
public boolean shouldReply()
- Specified by:
shouldReply
in interface TextCommand
- Overrides:
shouldReply
in class AbstractTextCommand
getURI
public String getURI()
send204
public void send204()
send400
public void send400()
setResponse
public void setResponse(byte[] value)
send200
public void send200()
setResponse
public 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
- Parameters:
contentType
- value
-
writeTo
public boolean writeTo(ByteBuffer bb)
- Description copied from interface:
SocketWritable
- Asks the SocketWritable to write its content to the destination ByteBuffer.
- Parameters:
bb
- the ByteBuffer to write to.
- Returns:
- todo: unclear what return value means.
toString
public String toString()
- Overrides:
toString
in class AbstractTextCommand
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.