T
- The type@Internal public abstract class AbstractHttpContentProcessor<T> extends SingleSubscriberProcessor<io.netty.buffer.ByteBufHolder,T> implements HttpContentProcessor<T>
HttpContentProcessor
interface that deals with limiting file upload sizes.Modifier and Type | Field and Description |
---|---|
protected long |
advertisedLength |
protected HttpServerConfiguration |
configuration |
protected NettyHttpRequest<?> |
nettyHttpRequest |
protected AtomicLong |
receivedLength |
protected long |
requestMaxSize |
EMPTY_SUBSCRIPTION, parentSubscription
subscription
Constructor and Description |
---|
AbstractHttpContentProcessor(NettyHttpRequest<?> nettyHttpRequest,
HttpServerConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
protected void |
doOnNext(io.netty.buffer.ByteBufHolder message)
Implement
Subscriber.onNext(Object) . |
protected void |
doSubscribe(Subscriber<? super T> subscriber)
Override to implement
Publisher.subscribe(Subscriber) . |
protected void |
fireExceedsLength(long receivedLength,
long expected,
io.netty.buffer.ByteBufHolder message) |
protected abstract void |
onData(io.netty.buffer.ByteBufHolder message)
Called after verifying the data of the message.
|
currentSubscriber, doAfterComplete, doAfterOnError, doAfterOnSubscribe, doOnComplete, doOnError, doOnSubscribe, doOnSubscribe, getSubscriber, subscribe
isComplete, onComplete, onError, onNext, onSubscribe
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onComplete, onError, onNext, onSubscribe
isEnabled
protected final NettyHttpRequest<?> nettyHttpRequest
protected final long advertisedLength
protected final long requestMaxSize
protected final AtomicLong receivedLength
protected final HttpServerConfiguration configuration
public AbstractHttpContentProcessor(NettyHttpRequest<?> nettyHttpRequest, HttpServerConfiguration configuration)
nettyHttpRequest
- The NettyHttpRequest
configuration
- The HttpServerConfiguration
protected abstract void onData(io.netty.buffer.ByteBufHolder message)
message
- The messageprotected final void doSubscribe(Subscriber<? super T> subscriber)
SingleSubscriberProcessor
Publisher.subscribe(Subscriber)
.doSubscribe
in class SingleSubscriberProcessor<io.netty.buffer.ByteBufHolder,T>
subscriber
- The subscriberPublisher.subscribe(Subscriber)
protected final void doOnNext(io.netty.buffer.ByteBufHolder message)
CompletionAwareSubscriber
Subscriber.onNext(Object)
.doOnNext
in class CompletionAwareSubscriber<io.netty.buffer.ByteBufHolder>
message
- The messageprotected void fireExceedsLength(long receivedLength, long expected, io.netty.buffer.ByteBufHolder message)
receivedLength
- The length of the content receivedexpected
- The expected length of the contentmessage
- The message to release