|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.http.AbstractGenerator org.eclipse.jetty.http.HttpGenerator
public class HttpGenerator
HttpGenerator. Builds HTTP Messages.
Field Summary |
---|
Fields inherited from class org.eclipse.jetty.http.AbstractGenerator |
---|
_buffer, _buffers, _close, _content, _contentBufferSize, _contentLength, _contentWritten, _endp, _head, _header, _headerBufferSize, _last, _method, _noContent, _reason, _state, _status, _uri, _version, MAX_OUTPUT_CHARS, NO_BYTES, STATE_CONTENT, STATE_END, STATE_FLUSHING, STATE_HEADER |
Fields inherited from interface org.eclipse.jetty.http.Generator |
---|
LAST, MORE |
Constructor Summary | |
---|---|
HttpGenerator(Buffers buffers,
EndPoint io,
int headerBufferSize,
int contentBufferSize)
Constructor. |
Method Summary | |
---|---|
void |
addContent(Buffer content,
boolean last)
Add content. |
boolean |
addContent(byte b)
Add content. |
void |
complete()
Complete the message. |
void |
completeHeader(HttpFields fields,
boolean allContentAdded)
|
long |
flushBuffer()
|
int |
getBytesBuffered()
|
static Buffer |
getReasonBuffer(int code)
|
boolean |
isBufferFull()
|
boolean |
isEmpty()
|
int |
prepareUncheckedAddContent()
Prepare buffer for unchecked writes. |
void |
reset(boolean returnBuffers)
|
void |
sendResponse(Buffer response)
send complete response. |
static void |
setServerVersion(String version)
|
String |
toString()
|
Methods inherited from class org.eclipse.jetty.http.AbstractGenerator |
---|
blockForOutput, completeUncheckedAddContent, flush, getContentBufferSize, getContentWritten, getSendServerVersion, getState, getUncheckedBuffer, getVersion, increaseContentBufferSize, isCommitted, isComplete, isContentWritten, isHead, isIdle, isOpen, isPersistent, isState, resetBuffer, sendError, setContentLength, setHead, setPersistent, setRequest, setResponse, setSendServerVersion, setVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HttpGenerator(Buffers buffers, EndPoint io, int headerBufferSize, int contentBufferSize)
buffers
- buffer poolheaderBufferSize
- Size of the buffer to allocate for HTTP headercontentBufferSize
- Size of the buffer to allocate for HTTP contentMethod Detail |
---|
public static Buffer getReasonBuffer(int code)
public static void setServerVersion(String version)
public void reset(boolean returnBuffers)
reset
in interface Generator
reset
in class AbstractGenerator
public 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
-
IOException
public boolean addContent(byte b) throws IOException
b
- byte
IOException
public int prepareUncheckedAddContent() throws IOException
prepareUncheckedAddContent
in class AbstractGenerator
IOException
public boolean isBufferFull()
isBufferFull
in interface Generator
isBufferFull
in class AbstractGenerator
public void completeHeader(HttpFields fields, boolean allContentAdded) throws IOException
completeHeader
in interface Generator
completeHeader
in class AbstractGenerator
IOException
public void complete() throws IOException
complete
in interface Generator
complete
in class AbstractGenerator
IOException
public long flushBuffer() throws IOException
flushBuffer
in interface Generator
flushBuffer
in class AbstractGenerator
IOException
public int getBytesBuffered()
public boolean isEmpty()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |