public class HttpGenerator extends AbstractGenerator
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_bypass |
_buffer, _buffers, _content, _contentLength, _contentWritten, _date, _endp, _head, _header, _last, _method, _noContent, _persistent, _reason, _state, _status, _uri, _version, NO_BYTES, STATE_CONTENT, STATE_END, STATE_FLUSHING, STATE_HEADER| Constructor and Description |
|---|
HttpGenerator(Buffers buffers,
EndPoint io)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContent(Buffer content,
boolean last)
Add content.
|
void |
complete()
Complete the message.
|
void |
completeHeader(HttpFields fields,
boolean allContentAdded) |
int |
flushBuffer() |
int |
getBytesBuffered() |
static Buffer |
getReasonBuffer(int code) |
boolean |
isBufferFull() |
boolean |
isEmpty() |
boolean |
isRequest() |
boolean |
isResponse() |
int |
prepareUncheckedAddContent()
Prepare buffer for unchecked writes.
|
void |
reset() |
void |
send1xx(int code) |
void |
sendResponse(Buffer response)
send complete response.
|
static void |
setServerVersion(String version) |
String |
toString() |
blockForOutput, completeUncheckedAddContent, flush, getContentBufferSize, getContentWritten, getSendServerVersion, getState, getUncheckedBuffer, getVersion, increaseContentBufferSize, isAllContentWritten, isCommitted, isComplete, isHead, isIdle, isOpen, isPersistent, isState, isWritten, resetBuffer, returnBuffers, sendError, setContentLength, setDate, setHead, setPersistent, setRequest, setResponse, setSendServerVersion, setVersionpublic static Buffer getReasonBuffer(int code)
public static void setServerVersion(String version)
public void reset()
reset in interface Generatorreset in class AbstractGeneratorpublic void addContent(Buffer content, boolean last) throws IOException
content - last - IllegalArgumentException - if content is immutable.IllegalStateException - If the request is not expecting any more content,
or if the buffers are full and cannot be flushed.IOException - if there is a problem flushing the buffers.public void sendResponse(Buffer response) throws IOException
response - IOExceptionpublic int prepareUncheckedAddContent()
throws IOException
prepareUncheckedAddContent in class AbstractGeneratorIOExceptionpublic boolean isBufferFull()
isBufferFull in interface GeneratorisBufferFull in class AbstractGeneratorpublic void send1xx(int code)
throws IOException
IOExceptionpublic boolean isRequest()
isRequest in class AbstractGeneratorpublic boolean isResponse()
isResponse in class AbstractGeneratorpublic void completeHeader(HttpFields fields, boolean allContentAdded) throws IOException
completeHeader in interface GeneratorcompleteHeader in class AbstractGeneratorIOExceptionpublic void complete()
throws IOException
complete in interface Generatorcomplete in class AbstractGeneratorIOExceptionpublic int flushBuffer()
throws IOException
flushBuffer in interface GeneratorflushBuffer in class AbstractGeneratorIOExceptionpublic int getBytesBuffered()
public boolean isEmpty()
Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.