|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StreamAlgorithm<E>
Generic parsing interface that can be used to implement protocol specific logic parsing.
| Method Summary | |
|---|---|
ByteBuffer |
allocate(boolean useDirect,
boolean useView,
int size)
Deprecated. Allocate a ByteBuffer |
int |
contentLength()
Deprecated. Return the stream content-length. |
Interceptor |
getHandler()
Deprecated. The Interceptor associated with this algorithm. |
int |
getPort()
Deprecated. Return the port |
int |
headerLength()
Deprecated. Return the stream header length. |
boolean |
parse(ByteBuffer byteBuffer)
Deprecated. Parse the ByteBuffer and try to determine if the bytes
stream has been fully read from the SocketChannel. |
ByteBuffer |
postParse(ByteBuffer byteBuffer)
Deprecated. After parsing the bytes, post process the ByteBuffer |
ByteBuffer |
preParse(ByteBuffer byteBuffer)
Deprecated. Before parsing the bytes, initialize and prepare the algorithm. |
void |
recycle()
Deprecated. Recycle the algorithm. |
ByteBuffer |
rollbackParseState(ByteBuffer byteBuffer)
Deprecated. Rollback the ByteBuffer to its previous state in case
an error as occured. |
void |
setChannel(E channel)
Deprecated. Set the Channel used by this algorithm |
void |
setPort(int port)
Deprecated. Set the port this algorithm is used. |
| Method Detail |
|---|
int contentLength()
int headerLength()
ByteBuffer allocate(boolean useDirect,
boolean useView,
int size)
ByteBuffer
useDirect - allocate a direct ByteBuffer.useView - allocate a view ByteBuffer.size - the size of the newly created ByteBuffer.
ByteBufferByteBuffer preParse(ByteBuffer byteBuffer)
byteBuffer - the ByteBuffer used by this algorithm
ByteBuffer used by this algorithmboolean parse(ByteBuffer byteBuffer)
ByteBuffer and try to determine if the bytes
stream has been fully read from the SocketChannel.
byteBuffer - the bytes read.
ByteBuffer postParse(ByteBuffer byteBuffer)
ByteBuffer
byteBuffer - the ByteBuffer used by this algorithm
ByteBuffer used by this algorithmvoid recycle()
ByteBuffer rollbackParseState(ByteBuffer byteBuffer)
ByteBuffer to its previous state in case
an error as occured.
byteBuffer -
ByteBufferInterceptor getHandler()
Interceptor associated with this algorithm.
Interceptorvoid setChannel(E channel)
Channel used by this algorithm
channek - set Channelvoid setPort(int port)
port this algorithm is used.
port - port numberint getPort()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||