|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.http.algorithms.StreamAlgorithmBase
com.sun.grizzly.http.algorithms.ContentLengthAlgorithm
com.sun.grizzly.http.algorithms.SeekHeaderAlgorithm
public final class SeekHeaderAlgorithm
Predict if the NIO channel has been fully read or not. This lagorithm will first search for the content-length header, and use that value to determine if the bytes has been fully read or not. If the content-length isn't included, it will search for the end of the HTTP stream, which is a '\r\n' without buffering the body.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sun.grizzly.http.algorithms.StreamAlgorithmBase |
|---|
StreamAlgorithmBase.DummyHandler |
| Field Summary |
|---|
| Fields inherited from class com.sun.grizzly.http.algorithms.ContentLengthAlgorithm |
|---|
ascbuf, CL_HEADER, isFound, lastValid, lengthReq, pos, POST_METHOD, PUT_METHOD, requestLineParsed, startReq |
| Fields inherited from class com.sun.grizzly.http.algorithms.StreamAlgorithmBase |
|---|
contentLength, curLimit, curPosition, handler, headerLength, lastStatePosition, primaryByteBuffer, socketChannel, state, useByteBufferView, useDirectByteBuffer |
| Constructor Summary | |
|---|---|
SeekHeaderAlgorithm()
|
|
| Method Summary | |
|---|---|
boolean |
parse(java.nio.ByteBuffer byteBuffer)
Parse the ByteBuffer and try to determine if the bytes
stream has been fully read from the SocketChannel. |
| Methods inherited from class com.sun.grizzly.http.algorithms.ContentLengthAlgorithm |
|---|
findBytes, getHandler, parseHeader, parseRequestLine, recycle |
| Methods inherited from class com.sun.grizzly.http.algorithms.StreamAlgorithmBase |
|---|
allocate, contentLength, dump, getPort, headerLength, postParse, preParse, rollbackParseState, setChannel, setPort |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SeekHeaderAlgorithm()
| Method Detail |
|---|
public boolean parse(java.nio.ByteBuffer byteBuffer)
ByteBuffer and try to determine if the bytes
stream has been fully read from the SocketChannel.
Drain the SocketChannel and determine if the request bytes
has been fully read. For POST method, parse the bytes and seek for the
content-type header to determine the length of the request bytes.
parse in interface StreamAlgorithm<java.nio.channels.SocketChannel>parse in class ContentLengthAlgorithmSelectorThread
This occurs when the stream doesn't contains all the
request bytes.
false if the stream contains all request bytes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||