public class InternalAprInputBuffer extends Object implements InputBuffer
Modifier and Type | Class and Description |
---|---|
protected class |
InternalAprInputBuffer.SocketInputBuffer
This class is an input buffer which will read its data from an input
stream.
|
Modifier and Type | Field and Description |
---|---|
protected InputFilter[] |
activeFilters
Active filters (in order).
|
protected boolean |
available
Non blocking mode.
|
protected ByteBuffer |
bbuf
Direct byte buffer used to perform actual reading.
|
protected byte[] |
buf
Pointer to the current read buffer.
|
protected int |
end
Pos of the end of the header in the buffer, which is also the
start of the body.
|
protected AprEndpoint |
endpoint
Apr endpoint.
|
protected InputFilter[] |
filterLibrary
Filter library.
|
protected MimeHeaders |
headers
Headers of the associated request.
|
protected InputBuffer |
inputStreamInputBuffer
Underlying input buffer.
|
protected int |
lastActiveFilter
Index of the last active filter.
|
protected int |
lastValid
Last valid byte.
|
protected boolean |
nonBlocking
Non blocking mode.
|
protected boolean |
parsingHeader
State.
|
protected int |
pos
Position in the buffer.
|
protected Request |
request
Associated Coyote request.
|
protected long |
socket
Underlying socket.
|
protected boolean |
swallowInput
Swallow input ? (in the case of an expectation)
|
Constructor and Description |
---|
InternalAprInputBuffer(Request request,
int headerBufferSize,
AprEndpoint endpoint)
Alternate constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addActiveFilter(InputFilter filter)
Add an input filter to the filter library.
|
void |
addFilter(InputFilter filter)
Add an input filter to the filter library.
|
boolean |
available()
Available bytes in the buffer ? (these may not translate to application
readable data)
|
void |
clearFilters()
Clear filters.
|
int |
doRead(ByteChunk chunk,
Request req)
Read some bytes.
|
void |
endRequest()
End request (consumes leftover bytes).
|
protected boolean |
fill()
Fill the internal buffer using data from the undelying input stream.
|
InputFilter[] |
getFilters()
Get filters.
|
boolean |
getNonBlocking()
Get the non blocking flag value.
|
long |
getSocket()
Get the underlying socket input stream.
|
boolean |
nextRequest()
End processing of current HTTP request.
|
boolean |
parseHeader()
Parse an HTTP header.
|
void |
parseHeaders()
Parse the HTTP headers.
|
boolean |
parseRequestLine(boolean useAvailableData)
Read the request line.
|
void |
recycle()
Recycle the input buffer.
|
void |
removeActiveFilters() |
void |
setNonBlocking(boolean nonBlocking)
Set the non blocking flag.
|
void |
setSocket(long socket)
Set the underlying socket.
|
void |
setSwallowInput(boolean swallowInput)
Set the swallow input flag.
|
void |
useAvailable()
Available bytes (note that due to encoding, this may not correspond )
|
protected Request request
protected MimeHeaders headers
protected boolean parsingHeader
protected boolean swallowInput
protected byte[] buf
protected int lastValid
protected int pos
protected int end
protected ByteBuffer bbuf
protected long socket
protected InputBuffer inputStreamInputBuffer
protected InputFilter[] filterLibrary
protected InputFilter[] activeFilters
protected int lastActiveFilter
protected boolean nonBlocking
protected boolean available
protected AprEndpoint endpoint
public InternalAprInputBuffer(Request request, int headerBufferSize, AprEndpoint endpoint)
public void setSocket(long socket)
public long getSocket()
public void setNonBlocking(boolean nonBlocking)
public boolean getNonBlocking()
public void addFilter(InputFilter filter)
public InputFilter[] getFilters()
public void clearFilters()
public void addActiveFilter(InputFilter filter)
public void removeActiveFilters()
public void setSwallowInput(boolean swallowInput)
public void recycle()
public boolean nextRequest()
public void endRequest() throws IOException
IOException
- an undelying I/O error occuredpublic boolean parseRequestLine(boolean useAvailableData) throws IOException
IOException
- If an exception occurs during the underlying socket
read operations, or if the given buffer is not big enough to accomodate
the whole line.public void parseHeaders() throws IOException
IOException
public boolean parseHeader() throws IOException
IOException
public void useAvailable()
public boolean available()
public int doRead(ByteChunk chunk, Request req) throws IOException
doRead
in interface InputBuffer
IOException
protected boolean fill() throws IOException
IOException
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.