Class ServerHttp1StreamDuplexer.DelayedOutputChannel
- java.lang.Object
-
- org.apache.hc.core5.http.impl.nio.ServerHttp1StreamDuplexer.DelayedOutputChannel
-
- All Implemented Interfaces:
Http1StreamChannel<HttpResponse>,ContentEncoder
- Enclosing class:
- ServerHttp1StreamDuplexer
private static class ServerHttp1StreamDuplexer.DelayedOutputChannel extends java.lang.Object implements Http1StreamChannel<HttpResponse>
-
-
Field Summary
Fields Modifier and Type Field Description private Http1StreamChannel<HttpResponse>channelprivate booleancompletedprivate HttpResponsedelayedResponseprivate booleandirect
-
Constructor Summary
Constructors Modifier Constructor Description privateDelayedOutputChannel(Http1StreamChannel<HttpResponse> channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabortGracefully()voidactivate()voidclose()voidcomplete(java.util.List<? extends Header> trailers)Terminates the content stream.TimeoutgetSocketTimeout()booleanisCompleted()Returnstrueif the entity has been transferred in its entirety.voidrequestOutput()voidsetSocketTimeout(Timeout timeout)voidsubmit(HttpResponse response, boolean endStream, FlushMode flushMode)voidsuspendOutput()intwrite(java.nio.ByteBuffer src)Writes a portion of entity content to the underlying channel.
-
-
-
Field Detail
-
channel
private final Http1StreamChannel<HttpResponse> channel
-
direct
private volatile boolean direct
-
delayedResponse
private volatile HttpResponse delayedResponse
-
completed
private volatile boolean completed
-
-
Constructor Detail
-
DelayedOutputChannel
private DelayedOutputChannel(Http1StreamChannel<HttpResponse> channel)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceHttp1StreamChannel<HttpResponse>
-
submit
public void submit(HttpResponse response, boolean endStream, FlushMode flushMode) throws HttpException, java.io.IOException
- Specified by:
submitin interfaceHttp1StreamChannel<HttpResponse>- Throws:
HttpExceptionjava.io.IOException
-
suspendOutput
public void suspendOutput() throws java.io.IOException- Specified by:
suspendOutputin interfaceHttp1StreamChannel<HttpResponse>- Throws:
java.io.IOException
-
requestOutput
public void requestOutput()
- Specified by:
requestOutputin interfaceHttp1StreamChannel<HttpResponse>
-
getSocketTimeout
public Timeout getSocketTimeout()
- Specified by:
getSocketTimeoutin interfaceHttp1StreamChannel<HttpResponse>
-
setSocketTimeout
public void setSocketTimeout(Timeout timeout)
- Specified by:
setSocketTimeoutin interfaceHttp1StreamChannel<HttpResponse>
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOExceptionDescription copied from interface:ContentEncoderWrites a portion of entity content to the underlying channel.- Specified by:
writein interfaceContentEncoder- Parameters:
src- The buffer from which content is to be retrieved- Returns:
- The number of bytes read, possibly zero
- Throws:
java.io.IOException- if I/O error occurs while writing content
-
complete
public void complete(java.util.List<? extends Header> trailers) throws java.io.IOException
Description copied from interface:ContentEncoderTerminates the content stream.- Specified by:
completein interfaceContentEncoder- Throws:
java.io.IOException- if I/O error occurs while writing content
-
abortGracefully
public boolean abortGracefully() throws java.io.IOException- Specified by:
abortGracefullyin interfaceHttp1StreamChannel<HttpResponse>- Throws:
java.io.IOException
-
isCompleted
public boolean isCompleted()
Description copied from interface:ContentEncoderReturnstrueif the entity has been transferred in its entirety.- Specified by:
isCompletedin interfaceContentEncoder- Returns:
trueif all the content has been produced,falseotherwise.
-
activate
public void activate() throws java.io.IOException, HttpException- Specified by:
activatein interfaceHttp1StreamChannel<HttpResponse>- Throws:
java.io.IOExceptionHttpException
-
-