Top Fields Constructors Methods
io.undertow.io

public Class BlockingReceiverImpl

extends Object
implements Receiver
Class Inheritance
All Implemented Interfaces
io.undertow.io.Receiver
Imports
java.io.ByteArrayOutputStream, .IOException, .InputStream, java.nio.CharBuffer, java.nio.charset.Charset, .CharsetDecoder, .StandardCharsets, io.undertow.UndertowLogger, .UndertowMessages, io.undertow.connector.PooledByteBuffer, io.undertow.server.HttpServerExchange, io.undertow.util.Headers, .StatusCodes

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private boolean
public static final byte[]
private static final Receiver.ErrorCallback
private final HttpServerExchange
private final InputStream
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
pause()

Implements io.undertow.io.Receiver.pause.

When receiving partial data calling this method will pause the callbacks.

public void
receiveFullBytes(final Receiver.FullBytesCallback
The callback to invoke with the request
callback
,
final Receiver.ErrorCallback
The callback that is invoked on error
errorCallback
)

Implements io.undertow.io.Receiver.receiveFullBytes.

Reads the request and invokes the callback when the request body has been fully read.

public void
receiveFullBytes(Receiver.FullBytesCallback
The callback to invoke with the request
callback
)

Implements io.undertow.io.Receiver.receiveFullBytes.

Reads the request and invokes the callback when the request body has been fully read.

public void
receiveFullString(final Receiver.FullStringCallback
The callback to invoke with the request
callback
,
Receiver.ErrorCallback
The callback that is invoked on error
errorCallback
)

Implements io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read.

public void
receiveFullString(Receiver.FullStringCallback
The callback to invoke with the request
callback
)

Implements io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read.

public void
receiveFullString(final Receiver.FullStringCallback
The callback to invoke with the request
callback
,
final Receiver.ErrorCallback
The callback that is invoked on error
errorCallback
,
final Charset
The charset that is used to interpret the string
charset
)

Implements io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read.

public void
receiveFullString(Receiver.FullStringCallback
The callback to invoke with the request
callback
,
Charset
The charset that is used to interpret the string
charset
)

Implements io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read.

public void
receivePartialBytes(final Receiver.PartialBytesCallback
The callback to invoke with the request
callback
,
final Receiver.ErrorCallback
The callback that is invoked on error
errorCallback
)

Implements io.undertow.io.Receiver.receivePartialBytes.

Reads the request and invokes the callback with request data.

public void
receivePartialBytes(Receiver.PartialBytesCallback
The callback to invoke with the request
callback
)

Implements io.undertow.io.Receiver.receivePartialBytes.

Reads the request and invokes the callback with request data.

public void
receivePartialString(Receiver.PartialStringCallback
The callback to invoke with the request
callback
,
Receiver.ErrorCallback
The callback that is invoked on error
errorCallback
)

Implements io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data.

public void
receivePartialString(Receiver.PartialStringCallback
The callback to invoke with the request
callback
)

Implements io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data.

public void
receivePartialString(final Receiver.PartialStringCallback
The callback to invoke with the request
callback
,
final Receiver.ErrorCallback
The callback that is invoked on error
errorCallback
,
Charset
The charset that is used to interpret the string
charset
)

Implements io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data.

public void
receivePartialString(Receiver.PartialStringCallback
The callback to invoke with the request
callback
,
Charset
The charset that is used to interpret the string
charset
)

Implements io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data.

public void
resume()

Implements io.undertow.io.Receiver.resume.

Resumes paused callbacks.

public void
setMaxBufferSize(int
The maximum amount of data to be buffered
maxBufferSize
)

Implements io.undertow.io.Receiver.setMaxBufferSize.

Sets the maximum amount of data that will be buffered in memory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

doneback to summary
private boolean done
EMPTY_BYTE_ARRAYback to summary
public static final byte[] EMPTY_BYTE_ARRAY
END_EXCHANGEback to summary
private static final Receiver.ErrorCallback END_EXCHANGE
exchangeback to summary
private final HttpServerExchange exchange
inputStreamback to summary
private final InputStream inputStream
maxBufferSizeback to summary
private int maxBufferSize

Constructor Detail

BlockingReceiverImplback to summary
public BlockingReceiverImpl(HttpServerExchange exchange, InputStream inputStream)

Method Detail

pauseback to summary
public void pause()

Implements io.undertow.io.Receiver.pause.

Doc from io.undertow.io.Receiver.pause.

When receiving partial data calling this method will pause the callbacks. Callbacks will not resume until resume() has been called.

Annotations
@Override
receiveFullBytesback to summary
public void receiveFullBytes(final Receiver.FullBytesCallback callback, final Receiver.ErrorCallback errorCallback)

Implements io.undertow.io.Receiver.receiveFullBytes.

Doc from io.undertow.io.Receiver.receiveFullBytes.

Reads the request and invokes the callback when the request body has been fully read. If there is an error reading the request the error callback will be invoked.

Parameters
callback:Receiver.FullBytesCallback

The callback to invoke with the request

errorCallback:Receiver.ErrorCallback

The callback that is invoked on error

Annotations
@Override
receiveFullBytesback to summary
public void receiveFullBytes(Receiver.FullBytesCallback callback)

Implements io.undertow.io.Receiver.receiveFullBytes.

Doc from io.undertow.io.Receiver.receiveFullBytes.

Reads the request and invokes the callback when the request body has been fully read. If there is an error the exchange will be ended.

Parameters
callback:Receiver.FullBytesCallback

The callback to invoke with the request

Annotations
@Override
receiveFullStringback to summary
public void receiveFullString(final Receiver.FullStringCallback callback, Receiver.ErrorCallback errorCallback)

Implements io.undertow.io.Receiver.receiveFullString.

Doc from io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to java.nio.charset.StandardCharsets#ISO_8859_1. If there is an error reading the request the error callback will be invoked.

Parameters
callback:Receiver.FullStringCallback

The callback to invoke with the request

errorCallback:Receiver.ErrorCallback

The callback that is invoked on error

Annotations
@Override
receiveFullStringback to summary
public void receiveFullString(Receiver.FullStringCallback callback)

Implements io.undertow.io.Receiver.receiveFullString.

Doc from io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to java.nio.charset.StandardCharsets#ISO_8859_1. If there is an error the exchange will be ended.

Parameters
callback:Receiver.FullStringCallback

The callback to invoke with the request

Annotations
@Override
receiveFullStringback to summary
public void receiveFullString(final Receiver.FullStringCallback callback, final Receiver.ErrorCallback errorCallback, final Charset charset)

Implements io.undertow.io.Receiver.receiveFullString.

Doc from io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to the specified charset. If there is an error reading the request the error callback will be invoked.

Parameters
callback:Receiver.FullStringCallback

The callback to invoke with the request

errorCallback:Receiver.ErrorCallback

The callback that is invoked on error

charset:Charset

The charset that is used to interpret the string

Annotations
@Override
receiveFullStringback to summary
public void receiveFullString(Receiver.FullStringCallback callback, Charset charset)

Implements io.undertow.io.Receiver.receiveFullString.

Doc from io.undertow.io.Receiver.receiveFullString.

Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to the specified charset. If there is an error the exchange will be ended.

Parameters
callback:Receiver.FullStringCallback

The callback to invoke with the request

charset:Charset

The charset that is used to interpret the string

Annotations
@Override
receivePartialBytesback to summary
public void receivePartialBytes(final Receiver.PartialBytesCallback callback, final Receiver.ErrorCallback errorCallback)

Implements io.undertow.io.Receiver.receivePartialBytes.

Doc from io.undertow.io.Receiver.receivePartialBytes.

Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. If there is an error reading the request the error callback will be invoked.

Parameters
callback:Receiver.PartialBytesCallback

The callback to invoke with the request

errorCallback:Receiver.ErrorCallback

The callback that is invoked on error

Annotations
@Override
receivePartialBytesback to summary
public void receivePartialBytes(Receiver.PartialBytesCallback callback)

Implements io.undertow.io.Receiver.receivePartialBytes.

Doc from io.undertow.io.Receiver.receivePartialBytes.

Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. If there is an error the exchange will be ended.

Parameters
callback:Receiver.PartialBytesCallback

The callback to invoke with the request

Annotations
@Override
receivePartialStringback to summary
public void receivePartialString(Receiver.PartialStringCallback callback, Receiver.ErrorCallback errorCallback)

Implements io.undertow.io.Receiver.receivePartialString.

Doc from io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to java.nio.charset.StandardCharsets#ISO_8859_1. If there is an error reading the request the error callback will be invoked.

Parameters
callback:Receiver.PartialStringCallback

The callback to invoke with the request

errorCallback:Receiver.ErrorCallback

The callback that is invoked on error

Annotations
@Override
receivePartialStringback to summary
public void receivePartialString(Receiver.PartialStringCallback callback)

Implements io.undertow.io.Receiver.receivePartialString.

Doc from io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to java.nio.charset.StandardCharsets#ISO_8859_1. If there is an error the exchange will be ended.

Parameters
callback:Receiver.PartialStringCallback

The callback to invoke with the request

Annotations
@Override
receivePartialStringback to summary
public void receivePartialString(final Receiver.PartialStringCallback callback, final Receiver.ErrorCallback errorCallback, Charset charset)

Implements io.undertow.io.Receiver.receivePartialString.

Doc from io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to the specified charset. If there is an error reading the request the error callback will be invoked.

Parameters
callback:Receiver.PartialStringCallback

The callback to invoke with the request

errorCallback:Receiver.ErrorCallback

The callback that is invoked on error

charset:Charset

The charset that is used to interpret the string

Annotations
@Override
receivePartialStringback to summary
public void receivePartialString(Receiver.PartialStringCallback callback, Charset charset)

Implements io.undertow.io.Receiver.receivePartialString.

Doc from io.undertow.io.Receiver.receivePartialString.

Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to the specified charset. If there is an error the exchange will be ended.

Parameters
callback:Receiver.PartialStringCallback

The callback to invoke with the request

charset:Charset

The charset that is used to interpret the string

Annotations
@Override
resumeback to summary
public void resume()

Implements io.undertow.io.Receiver.resume.

Doc from io.undertow.io.Receiver.resume.

Resumes paused callbacks.

Annotations
@Override
setMaxBufferSizeback to summary
public void setMaxBufferSize(int maxBufferSize)

Implements io.undertow.io.Receiver.setMaxBufferSize.

Doc from io.undertow.io.Receiver.setMaxBufferSize.

Sets the maximum amount of data that will be buffered in memory. If you call a receiveFull* method and the request size is larger than this amount then the error callback with be invoked with a RequestTooBigException.

Parameters
maxBufferSize:int

The maximum amount of data to be buffered

Annotations
@Override