Top Description Fields Constructors Methods
org.apache.coyote.http11.filters

public Class SavedRequestInputFilter

extends Object
implements InputFilter
Class Inheritance
All Implemented Interfaces
org.apache.coyote.http11.InputFilter, org.apache.coyote.InputBuffer
Imports
java.io.IOException, java.nio.ByteBuffer, org.apache.coyote.InputBuffer, org.apache.coyote.http11.InputFilter, org.apache.tomcat.util.buf.ByteChunk, org.apache.tomcat.util.net.ApplicationBufferHandler

Input filter responsible for replaying the request body when restoring the saved request after FORM authentication.

Field Summary

Modifier and TypeField and Description
protected ByteChunk
input

The original request body.

Constructor Summary

AccessConstructor and Description
public
SavedRequestInputFilter(ByteChunk
The saved request body to be replayed.
input
)

Create a new SavedRequestInputFilter.

Method Summary

Modifier and TypeMethod and Description
public int
available()

Implements org.apache.coyote.InputBuffer.available.

Amount of bytes still available in a buffer.

public int
doRead(ApplicationBufferHandler
ApplicationBufferHandler that provides the buffer to read data into.
handler
)

Implements org.apache.coyote.InputBuffer.doRead.

Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler.

public long
end()

Implements org.apache.coyote.http11.InputFilter.end.

End the current request (has no effect).

public ByteChunk
getEncodingName()

Implements org.apache.coyote.http11.InputFilter.getEncodingName.

Return the name of the associated encoding; here, the value is null.

public boolean
isFinished()

Implements org.apache.coyote.http11.InputFilter.isFinished.

Has the request body been read fully?

public void
recycle()

Implements org.apache.coyote.http11.InputFilter.recycle.

Make the filter ready to process the next request.

public void
setBuffer(InputBuffer
The next buffer
buffer
)

Implements org.apache.coyote.http11.InputFilter.setBuffer.

Set the next buffer in the filter pipeline (has no effect).

public void
setRequest(Request
The request to be associated with this filter
request
)

Implements org.apache.coyote.http11.InputFilter.setRequest.

Set the content length on the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inputback to summary
protected ByteChunk input

The original request body.

Constructor Detail

SavedRequestInputFilterback to summary
public SavedRequestInputFilter(ByteChunk input)

Create a new SavedRequestInputFilter.

Parameters
input:ByteChunk

The saved request body to be replayed.

Method Detail

availableback to summary
public int available()

Implements org.apache.coyote.InputBuffer.available.

Amount of bytes still available in a buffer.

Returns:int

Doc from org.apache.coyote.InputBuffer.available.

The number of bytes that can be read without blocking

Annotations
@Override
doReadback to summary
public int doRead(ApplicationBufferHandler handler) throws IOException

Implements org.apache.coyote.InputBuffer.doRead.

Doc from org.apache.coyote.InputBuffer.doRead.

Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler.

Important Note

the current model assumes that the protocol will 'own' the ByteBuffer and return a pointer to it.

Parameters
handler:ApplicationBufferHandler

ApplicationBufferHandler that provides the buffer to read data into.

Returns:int

The number of bytes that have been added to the buffer or -1 for end of stream

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs reading from the input stream
endback to summary
public long end() throws IOException

Implements org.apache.coyote.http11.InputFilter.end.

End the current request (has no effect).

Returns:long

Doc from org.apache.coyote.http11.InputFilter.end.

0 is the expected return value. A positive value indicates that too many bytes were read. This method is allowed to use buffer.doRead to consume extra bytes. The result of this method can't be negative (if an error happens, an IOException should be thrown instead).

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.coyote.http11.InputFilter.end.

If an error happens

getEncodingNameback to summary
public ByteChunk getEncodingName()

Implements org.apache.coyote.http11.InputFilter.getEncodingName.

Return the name of the associated encoding; here, the value is null.

Returns:ByteChunk

Doc from org.apache.coyote.http11.InputFilter.getEncodingName.

The encoding name as a byte chunk to facilitate comparison with the value read from the HTTP headers which will also be a ByteChunk

Annotations
@Override
isFinishedback to summary
public boolean isFinished()

Implements org.apache.coyote.http11.InputFilter.isFinished.

Doc from org.apache.coyote.http11.InputFilter.isFinished.

Has the request body been read fully?

Returns:boolean

true if the request body has been fully read, otherwise false

Annotations
@Override
recycleback to summary
public void recycle()

Implements org.apache.coyote.http11.InputFilter.recycle.

Make the filter ready to process the next request.

Annotations
@Override
setBufferback to summary
public void setBuffer(InputBuffer buffer)

Implements org.apache.coyote.http11.InputFilter.setBuffer.

Set the next buffer in the filter pipeline (has no effect).

Parameters
buffer:InputBuffer

Doc from org.apache.coyote.http11.InputFilter.setBuffer.

The next buffer

Annotations
@Override
setRequestback to summary
public void setRequest(Request request)

Implements org.apache.coyote.http11.InputFilter.setRequest.

Set the content length on the request.

Parameters
request:Request

Doc from org.apache.coyote.http11.InputFilter.setRequest.

The request to be associated with this filter

Annotations
@Override