Top Description Inners Fields Constructors Methods
io.undertow.server.protocol.http

public Class HttpContinue

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.channels.Channel, java.util.Collections, .HashSet, .List, .Set, java.util.concurrent.TimeUnit, org.xnio.ChannelExceptionHandler, .ChannelListener, .ChannelListeners, org.xnio.channels.StreamSinkChannel, io.undertow.UndertowMessages, io.undertow.io.IoCallback, io.undertow.server.HttpHandler, .HttpServerExchange, io.undertow.util.AttachmentKey, .HeaderMap, .Headers, .HttpString, .Protocols, .StatusCodes

Class that provides support for dealing with HTTP 100 (Continue) responses.

Note that if a client is pipelining some requests and sending continue for others this could cause problems if the pipelining buffer is enabled.

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
HttpContinue.ContinueResponseSender

A continue response that is in the process of being sent.

Field Summary

Modifier and TypeField and Description
private static final AttachmentKey<Boolean>
private static final Set<HttpString>
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static HttpContinue.ContinueResponseSender

Returns:

The response sender
createResponseSender
(final HttpServerExchange
The exchange
exchange
)

Creates a response sender that can be used to send a HTTP 100-continue response.

private static void
public static boolean
public static void
markContinueResponseSent(HttpServerExchange
The exchange
exchange
)

Marks a continue response as already having been sent.

public static void
rejectExchange(final HttpServerExchange
The exchange to reject
exchange
)

Sets a 417 response code and ends the exchange.

public static boolean

Returns:

true if the server needs to send a continue response
requiresContinueResponse
(final HttpServerExchange
The exchange
exchange
)

Returns true if this exchange requires the server to send a 100 (Continue) response.

public static boolean
public static void
sendContinueResponse(final HttpServerExchange
The exchange
exchange
,
final IoCallback
The completion callback
callback
)

Sends a continuation using async IO, and calls back when it is complete.

public static void
sendContinueResponseBlocking(final HttpServerExchange
The exchange
exchange
)

Sends a continue response using blocking IO

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALREADY_SENTback to summary
private static final AttachmentKey<Boolean> ALREADY_SENT
COMPATIBLE_PROTOCOLSback to summary
private static final Set<HttpString> COMPATIBLE_PROTOCOLS
CONTINUEback to summary
public static final String CONTINUE

Constructor Detail

HttpContinueback to summary
public HttpContinue()

Method Detail

createResponseSenderback to summary
public static HttpContinue.ContinueResponseSender createResponseSender(final HttpServerExchange exchange) throws IOException

Creates a response sender that can be used to send a HTTP 100-continue response.

Parameters
exchange:HttpServerExchange

The exchange

Returns:HttpContinue.ContinueResponseSender

The response sender

internalSendContinueResponseback to summary
private static void internalSendContinueResponse(final HttpServerExchange exchange, final IoCallback callback)
isContinueResponseSentback to summary
public static boolean isContinueResponseSent(HttpServerExchange exchange)
markContinueResponseSentback to summary
public static void markContinueResponseSent(HttpServerExchange exchange)

Marks a continue response as already having been sent. In general this should only be used by low level handlers than need fine grained control over the continue response.

Parameters
exchange:HttpServerExchange

The exchange

rejectExchangeback to summary
public static void rejectExchange(final HttpServerExchange exchange)

Sets a 417 response code and ends the exchange.

Parameters
exchange:HttpServerExchange

The exchange to reject

requiresContinueResponseback to summary
public static boolean requiresContinueResponse(final HttpServerExchange exchange)

Returns true if this exchange requires the server to send a 100 (Continue) response.

Parameters
exchange:HttpServerExchange

The exchange

Returns:boolean

true if the server needs to send a continue response

requiresContinueResponseback to summary
public static boolean requiresContinueResponse(HeaderMap requestHeaders)
sendContinueResponseback to summary
public static void sendContinueResponse(final HttpServerExchange exchange, final IoCallback callback)

Sends a continuation using async IO, and calls back when it is complete.

Parameters
exchange:HttpServerExchange

The exchange

callback:IoCallback

The completion callback

sendContinueResponseBlockingback to summary
public static void sendContinueResponseBlocking(final HttpServerExchange exchange) throws IOException

Sends a continue response using blocking IO

Parameters
exchange:HttpServerExchange

The exchange

io.undertow.server.protocol.http back to summary

public Interface HttpContinue.ContinueResponseSender


A continue response that is in the process of being sent.

Method Summary

Modifier and TypeMethod and Description
public void
public void
awaitWritable(long time, final TimeUnit timeUnit)

public boolean

Returns:

true if the response is fully sent, false otherwise.
send
()

Continue sending the response.

Method Detail

awaitWritableback to summary
public void awaitWritable() throws IOException
awaitWritableback to summary
public void awaitWritable(long time, final TimeUnit timeUnit) throws IOException
sendback to summary
public boolean send() throws IOException

Continue sending the response.

Returns:boolean

true if the response is fully sent, false otherwise.