Top Description Inners Fields Constructors Methods
io.undertow.server.handlers

public Class HttpContinueReadHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.FileChannel, java.util.concurrent.TimeUnit, org.xnio.channels.StreamSinkChannel, org.xnio.conduits.AbstractStreamSourceConduit, .StreamSourceConduit, io.undertow.server.ConduitWrapper, .Connectors, .HttpHandler, .HttpServerExchange, .ResponseCommitListener, io.undertow.server.protocol.http.HttpContinue, io.undertow.util.ConduitFactory, .StatusCodes

Handler for requests that require 100-continue responses. If an attempt is made to read from the source channel then a 100 continue response is sent.
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static enum

Field Summary

Modifier and TypeField and Description
private final HttpHandler
private static final ConduitWrapper<StreamSourceConduit>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handlerback to summary
private final HttpHandler handler
WRAPPERback to summary
private static final ConduitWrapper<StreamSourceConduit> WRAPPER

Constructor Detail

HttpContinueReadHandlerback to summary
public HttpContinueReadHandler(final HttpHandler handler)

Method Detail

handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
io.undertow.server.handlers back to summary

private final Class HttpContinueReadHandler.ContinueConduit

extends AbstractStreamSourceConduit<StreamSourceConduit>
implements StreamSourceConduit
Class Inheritance
All Implemented Interfaces
org.xnio.conduits.StreamSourceConduit, org.xnio.conduits.SourceConduit, org.xnio.conduits.Conduit

Field Summary

Modifier and TypeField and Description
private final HttpServerExchange
private HttpContinue.ContinueResponseSender
private boolean

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
awaitReadable(final long
the time to wait
time
,
final TimeUnit
the time unit
timeUnit
)

Overrides org.xnio.conduits.AbstractSourceConduit.awaitReadable.

Implements org.xnio.conduits.SourceConduit.awaitReadable.

Block until this conduit becomes readable again, or until the timeout expires.

public void
awaitReadable()

Overrides org.xnio.conduits.AbstractSourceConduit.awaitReadable.

Implements org.xnio.conduits.SourceConduit.awaitReadable.

Block until this channel becomes readable again.

public int
read(final ByteBuffer
the buffer to fill with data from the conduit
dst
)

Overrides org.xnio.conduits.AbstractStreamSourceConduit.read.

Implements org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffer.

public long
read(final ByteBuffer[]
the buffers to fill with data from the conduit
dsts
,
final int
the offset into the buffer array
offs
,
final int
the number of buffers to fill
len
)

Overrides org.xnio.conduits.AbstractStreamSourceConduit.read.

Implements org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffers.

public long
transferTo(final long
the position within the file from which the transfer is to begin
position
,
final long
the number of bytes to be transferred
count
,
final FileChannel
the file to write to
target
)

Overrides org.xnio.conduits.AbstractStreamSourceConduit.transferTo.

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given file from this channel.

public long
transferTo(final long
the number of bytes to be transferred
count
,
final ByteBuffer
the buffer to copy through.
throughBuffer
,
final StreamSinkChannel
the destination to write to
target
)

Overrides org.xnio.conduits.AbstractStreamSourceConduit.transferTo.

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given channel target.

Field Detail

exchangeback to summary
private final HttpServerExchange exchange
responseback to summary
private HttpContinue.ContinueResponseSender response
sentback to summary
private boolean sent

Constructor Detail

ContinueConduitback to summary
protected ContinueConduit(final StreamSourceConduit next, final HttpServerExchange exchange)

Method Detail

awaitReadableback to summary
public void awaitReadable(final long time, final TimeUnit timeUnit) throws IOException

Overrides org.xnio.conduits.AbstractSourceConduit.awaitReadable.

Implements org.xnio.conduits.SourceConduit.awaitReadable.

Doc from org.xnio.conduits.SourceConduit.awaitReadable.

Block until this conduit becomes readable again, or until the timeout expires. This method may return spuriously before the conduit becomes readable or the timeout expires.

Parameters
time:long

the time to wait

timeUnit:TimeUnit

the time unit

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
awaitReadableback to summary
public void awaitReadable() throws IOException

Overrides org.xnio.conduits.AbstractSourceConduit.awaitReadable.

Implements org.xnio.conduits.SourceConduit.awaitReadable.

Doc from org.xnio.conduits.SourceConduit.awaitReadable.

Block until this channel becomes readable again. This method may return spuriously before the channel becomes readable.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
readback to summary
public int read(final ByteBuffer dst) throws IOException

Overrides org.xnio.conduits.AbstractStreamSourceConduit.read.

Implements org.xnio.conduits.StreamSourceConduit.read.

Doc from org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffer.

Parameters
dst:ByteBuffer

the buffer to fill with data from the conduit

Returns:int

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached or this conduit's terminateReads() method was previously called

Annotations
@Override
Exceptions
IOException:
if an error occurs
readback to summary
public long read(final ByteBuffer[] dsts, final int offs, final int len) throws IOException

Overrides org.xnio.conduits.AbstractStreamSourceConduit.read.

Implements org.xnio.conduits.StreamSourceConduit.read.

Doc from org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffers.

Parameters
dsts:ByteBuffer[]

the buffers to fill with data from the conduit

offs:int

the offset into the buffer array

len:int

the number of buffers to fill

Returns:long

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached or this conduit's terminateReads() method was previously called

Annotations
@Override
Exceptions
IOException:
if an error occurs
transferToback to summary
public long transferTo(final long position, final long count, final FileChannel target) throws IOException

Overrides org.xnio.conduits.AbstractStreamSourceConduit.transferTo.

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Doc from org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given file from this channel.

Parameters
position:long

the position within the file from which the transfer is to begin

count:long

the number of bytes to be transferred

target:FileChannel

the file to write to

Returns:long

the number of bytes (possibly 0) that were actually transferred

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
transferToback to summary
public long transferTo(final long count, final ByteBuffer throughBuffer, final StreamSinkChannel target) throws IOException

Overrides org.xnio.conduits.AbstractStreamSourceConduit.transferTo.

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Doc from org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given channel target. On entry, throughBuffer will be cleared. On exit, the buffer will be flipped for emptying, and may possibly be empty or may contain data. If this method returns a value less than count, then the remaining data in throughBuffer may contain data read from this channel which must be written to target to complete the operation.

Parameters
count:long

the number of bytes to be transferred

throughBuffer:ByteBuffer

the buffer to copy through.

target:StreamSinkChannel

the destination to write to

Returns:long

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
io.undertow.server.handlers back to summary

private final Enum HttpContinueReadHandler.ContinueResponseCommitListener

extends Enum<HttpContinueReadHandler.ContinueResponseCommitListener>
implements ResponseCommitListener
Class Inheritance
All Implemented Interfaces
io.undertow.server.ResponseCommitListener

Field Summary

Modifier and TypeField and Description
public static final HttpContinueReadHandler.ContinueResponseCommitListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
beforeCommit(HttpServerExchange
The server exchange
exchange
)

Implements io.undertow.server.ResponseCommitListener.beforeCommit.

Invoked before the first bytes of the response are sent to the client

public static HttpContinueReadHandler.ContinueResponseCommitListener
public static HttpContinueReadHandler.ContinueResponseCommitListener[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final HttpContinueReadHandler.ContinueResponseCommitListener INSTANCE

Constructor Detail

ContinueResponseCommitListenerback to summary
private ContinueResponseCommitListener()

Method Detail

beforeCommitback to summary
public void beforeCommit(HttpServerExchange exchange)

Implements io.undertow.server.ResponseCommitListener.beforeCommit.

Doc from io.undertow.server.ResponseCommitListener.beforeCommit.

Invoked before the first bytes of the response are sent to the client

Parameters
exchange:HttpServerExchange

The server exchange

Annotations
@Override
valueOfback to summary
public static HttpContinueReadHandler.ContinueResponseCommitListener valueOf(String name)
valuesback to summary
public static HttpContinueReadHandler.ContinueResponseCommitListener[] values()