Top Description Inners Fields Constructors Methods
org.apache.hc.core5.http.impl.nio

public Class ServerHttp1StreamDuplexer

extends AbstractHttp1StreamDuplexer<HttpRequest, HttpResponse>
Class Inheritance
Annotations
@Internal
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.ReadableByteChannel, .WritableByteChannel, java.util.List, .Queue, java.util.concurrent.ConcurrentLinkedQueue, org.apache.hc.core5.annotation.Internal, org.apache.hc.core5.http.ConnectionClosedException, .ConnectionReuseStrategy, .ContentLengthStrategy, .EntityDetails, .Header, .HttpException, .HttpRequest, .HttpResponse, .HttpStatus, org.apache.hc.core5.http.config.CharCodingConfig, .Http1Config, org.apache.hc.core5.http.impl.BasicHttpConnectionMetrics, .BasicHttpTransportMetrics, .DefaultConnectionReuseStrategy, .Http1StreamListener, org.apache.hc.core5.http.nio.AsyncServerExchangeHandler, .CapacityChannel, .ContentDecoder, .ContentEncoder, .HandlerFactory, .NHttpMessageParser, .NHttpMessageWriter, .SessionInputBuffer, .SessionOutputBuffer, org.apache.hc.core5.http.nio.command.RequestExecutionCommand, org.apache.hc.core5.http.protocol.HttpCoreContext, .HttpProcessor, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.reactor.ProtocolIOSession, org.apache.hc.core5.util.Args, .Asserts, .Timeout

I/O event handler for events fired by ProtocolIOSession that implements server side HTTP/1.1 messaging protocol with full support for duplexed message transmission and message pipelining.
Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ConnectionReuseStrategy
private final HandlerFactory<AsyncServerExchangeHandler>
private final Http1Config
private final HttpProcessor
private volatile ServerHttp1StreamHandler
private volatile ServerHttp1StreamHandler
private final Http1StreamChannel<HttpResponse>
private final Queue<ServerHttp1StreamHandler>
private final String
private final Http1StreamListener

Constructor Summary

AccessConstructor and Description
public
ServerHttp1StreamDuplexer(final ProtocolIOSession ioSession, final HttpProcessor httpProcessor, final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory, final String scheme, final Http1Config http1Config, final CharCodingConfig charCodingConfig, final ConnectionReuseStrategy connectionReuseStrategy, final NHttpMessageParser<HttpRequest> incomingMessageParser, final NHttpMessageWriter<HttpResponse> outgoingMessageWriter, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final Http1StreamListener streamListener)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv void
protected ContentDecoder
protected ContentEncoder
pack-priv void
pack-priv void
pack-priv void
protected boolean
protected boolean
pack-priv boolean
pack-priv void
pack-priv boolean
pack-priv boolean
pack-priv void
pack-priv boolean
pack-priv HttpRequest
pack-priv void
pack-priv void
pack-priv void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv void
pack-priv void
pack-priv void
Inherited from org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer:
closeclosecommitMessageHeadendOutputStreamgetEndpointDetailsgetIdgetLocalAddressgetProtocolVersiongetRemoteAddressgetSessionTimeoutgetSocketTimeoutgetSSLSessionisActiveisOpenisOutputCompletedisShuttingDownonConnectonDisconnectonExceptiononInputonOutputonTimeoutrequestSessionInputrequestSessionOutputrequestShutdownsetSessionTimeoutsetSocketTimeoutshutdownSessionshutdownSessionstreamOutputsuspendSessionInputsuspendSessionOutput

Field Detail

connectionReuseStrategyback to summary
private final ConnectionReuseStrategy connectionReuseStrategy
exchangeHandlerFactoryback to summary
private final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory
http1Configback to summary
private final Http1Config http1Config

Hides org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.http1Config.

httpProcessorback to summary
private final HttpProcessor httpProcessor
incomingback to summary
private volatile ServerHttp1StreamHandler incoming
outgoingback to summary
private volatile ServerHttp1StreamHandler outgoing
outputChannelback to summary
private final Http1StreamChannel<HttpResponse> outputChannel
pipelineback to summary
private final Queue<ServerHttp1StreamHandler> pipeline
schemeback to summary
private final String scheme
streamListenerback to summary
private final Http1StreamListener streamListener

Constructor Detail

ServerHttp1StreamDuplexerback to summary
public ServerHttp1StreamDuplexer(final ProtocolIOSession ioSession, final HttpProcessor httpProcessor, final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory, final String scheme, final Http1Config http1Config, final CharCodingConfig charCodingConfig, final ConnectionReuseStrategy connectionReuseStrategy, final NHttpMessageParser<HttpRequest> incomingMessageParser, final NHttpMessageWriter<HttpResponse> outgoingMessageWriter, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final Http1StreamListener streamListener)

Method Detail

appendStateback to summary
pack-priv void appendState(final StringBuilder buf)

Overrides org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.appendState.

Annotations
@Override
consumeDataback to summary
pack-priv void consumeData(final ByteBuffer src) throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.consumeData.

Annotations
@Override
consumeHeaderback to summary
pack-priv void consumeHeader(final HttpRequest request, final EntityDetails entityDetails) throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.consumeHeader.

Annotations
@Override
createContentDecoderback to summary
protected ContentDecoder createContentDecoder(final long len, final ReadableByteChannel channel, final SessionInputBuffer buffer, final BasicHttpTransportMetrics metrics) throws HttpException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.createContentDecoder.

Annotations
@Override
createContentEncoderback to summary
protected ContentEncoder createContentEncoder(final long len, final WritableByteChannel channel, final SessionOutputBuffer buffer, final BasicHttpTransportMetrics metrics) throws HttpException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.createContentEncoder.

Annotations
@Override
dataEndback to summary
pack-priv void dataEnd(final List<? extends Header> trailers) throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.dataEnd.

Annotations
@Override
disconnectedback to summary
pack-priv void disconnected()

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.disconnected.

Annotations
@Override
executeback to summary
pack-priv void execute(final RequestExecutionCommand executionCommand) throws HttpException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.execute.

Annotations
@Override
handleIncomingMessageback to summary
protected boolean handleIncomingMessage(final HttpRequest request) throws HttpException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.handleIncomingMessage.

Annotations
@Override
handleOutgoingMessageback to summary
protected boolean handleOutgoingMessage(final HttpResponse response) throws HttpException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.handleOutgoingMessage.

Annotations
@Override
handleTimeoutback to summary
pack-priv boolean handleTimeout()

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.handleTimeout.

Annotations
@Override
inputEndback to summary
pack-priv void inputEnd() throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.inputEnd.

Annotations
@Override
inputIdleback to summary
pack-priv boolean inputIdle()

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.inputIdle.

Annotations
@Override
isOutputReadyback to summary
pack-priv boolean isOutputReady()

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.isOutputReady.

Annotations
@Override
outputEndback to summary
pack-priv void outputEnd() throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.outputEnd.

Annotations
@Override
outputIdleback to summary
pack-priv boolean outputIdle()

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.outputIdle.

Annotations
@Override
parseMessageHeadback to summary
pack-priv HttpRequest parseMessageHead(final boolean endOfStream) throws IOException, HttpException

Overrides org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.parseMessageHead.

Annotations
@Override
produceOutputback to summary
pack-priv void produceOutput() throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.produceOutput.

Annotations
@Override
terminateback to summary
pack-priv void terminate(final Exception exception)

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.terminate.

Annotations
@Override
terminateExchangeback to summary
pack-priv void terminateExchange(final HttpException ex) throws HttpException, IOException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
updateCapacityback to summary
pack-priv void updateCapacity(final CapacityChannel capacityChannel) throws HttpException, IOException

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.updateCapacity.

Annotations
@Override
updateInputMetricsback to summary
pack-priv void updateInputMetrics(final HttpRequest request, final BasicHttpConnectionMetrics connMetrics)

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.updateInputMetrics.

Annotations
@Override
updateOutputMetricsback to summary
pack-priv void updateOutputMetrics(final HttpResponse response, final BasicHttpConnectionMetrics connMetrics)

Implements abstract org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.updateOutputMetrics.

Annotations
@Override
org.apache.hc.core5.http.impl.nio back to summary

private Class ServerHttp1StreamDuplexer.DelayedOutputChannel

extends Object
implements Http1StreamChannel<HttpResponse>
Class Inheritance
  • java.lang.Object
  • org.apache.hc.core5.http.impl.nio.ServerHttp1StreamDuplexer.DelayedOutputChannel
All Implemented Interfaces
org.apache.hc.core5.http.impl.nio.Http1StreamChannel, org.apache.hc.core5.http.nio.ContentEncoder

Field Summary

Modifier and TypeField and Description
private final Http1StreamChannel<HttpResponse>
private volatile boolean
private volatile HttpResponse
private volatile boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
public void
public void
complete(final List<? extends Header> trailers)

Implements org.apache.hc.core5.http.nio.ContentEncoder.complete.

Terminates the content stream.
public Timeout
public boolean
isCompleted()

Implements org.apache.hc.core5.http.nio.ContentEncoder.isCompleted.

Returns true if the entity has been transferred in its entirety.
public void
public void
public void
submit(final HttpResponse response, final boolean endStream, final FlushMode flushMode)

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.submit.

public void
public int
write(final ByteBuffer
The buffer from which content is to be retrieved
src
)

Implements org.apache.hc.core5.http.nio.ContentEncoder.write.

Writes a portion of entity content to the underlying channel.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

channelback to summary
private final Http1StreamChannel<HttpResponse> channel
completedback to summary
private volatile boolean completed
delayedResponseback to summary
private volatile HttpResponse delayedResponse
directback to summary
private volatile boolean direct

Constructor Detail

DelayedOutputChannelback to summary
private DelayedOutputChannel(final Http1StreamChannel<HttpResponse> channel)

Method Detail

abortGracefullyback to summary
public boolean abortGracefully() throws IOException

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.abortGracefully.

Annotations
@Override
activateback to summary
public void activate() throws IOException, HttpException

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.activate.

Annotations
@Override
closeback to summary
public void close()

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.close.

Annotations
@Override
completeback to summary
public void complete(final List<? extends Header> trailers) throws IOException

Implements org.apache.hc.core5.http.nio.ContentEncoder.complete.

Doc from org.apache.hc.core5.http.nio.ContentEncoder.complete.

Terminates the content stream.

Annotations
@Override
Exceptions
IOException:
if I/O error occurs while writing content
getSocketTimeoutback to summary
public Timeout getSocketTimeout()

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.getSocketTimeout.

Annotations
@Override
isCompletedback to summary
public boolean isCompleted()

Implements org.apache.hc.core5.http.nio.ContentEncoder.isCompleted.

Doc from org.apache.hc.core5.http.nio.ContentEncoder.isCompleted.

Returns true if the entity has been transferred in its entirety.

Returns:boolean

true if all the content has been produced, false otherwise.

Annotations
@Override
requestOutputback to summary
public void requestOutput()

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.requestOutput.

Annotations
@Override
setSocketTimeoutback to summary
public void setSocketTimeout(final Timeout timeout)

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.setSocketTimeout.

Annotations
@Override
submitback to summary
public void submit(final HttpResponse response, final boolean endStream, final FlushMode flushMode) throws HttpException, IOException

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.submit.

Annotations
@Override
suspendOutputback to summary
public void suspendOutput() throws IOException

Implements org.apache.hc.core5.http.impl.nio.Http1StreamChannel.suspendOutput.

Annotations
@Override
writeback to summary
public int write(final ByteBuffer src) throws IOException

Implements org.apache.hc.core5.http.nio.ContentEncoder.write.

Doc from org.apache.hc.core5.http.nio.ContentEncoder.write.

Writes a portion of entity content to the underlying channel.

Parameters
src:ByteBuffer

The buffer from which content is to be retrieved

Returns:int

The number of bytes read, possibly zero

Annotations
@Override
Exceptions
IOException:
if I/O error occurs while writing content