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>
channel
private boolean
completed
private HttpResponse
delayedResponse
private boolean
direct
-
Constructor Summary
Constructors Modifier Constructor Description private
DelayedOutputChannel(Http1StreamChannel<HttpResponse> channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abortGracefully()
void
activate()
void
close()
void
complete(java.util.List<? extends Header> trailers)
Terminates the content stream.Timeout
getSocketTimeout()
boolean
isCompleted()
Returnstrue
if the entity has been transferred in its entirety.void
requestOutput()
void
setSocketTimeout(Timeout timeout)
void
submit(HttpResponse response, boolean endStream, FlushMode flushMode)
void
suspendOutput()
int
write(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:
close
in interfaceHttp1StreamChannel<HttpResponse>
-
submit
public void submit(HttpResponse response, boolean endStream, FlushMode flushMode) throws HttpException, java.io.IOException
- Specified by:
submit
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
HttpException
java.io.IOException
-
suspendOutput
public void suspendOutput() throws java.io.IOException
- Specified by:
suspendOutput
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
java.io.IOException
-
requestOutput
public void requestOutput()
- Specified by:
requestOutput
in interfaceHttp1StreamChannel<HttpResponse>
-
getSocketTimeout
public Timeout getSocketTimeout()
- Specified by:
getSocketTimeout
in interfaceHttp1StreamChannel<HttpResponse>
-
setSocketTimeout
public void setSocketTimeout(Timeout timeout)
- Specified by:
setSocketTimeout
in interfaceHttp1StreamChannel<HttpResponse>
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException
Description copied from interface:ContentEncoder
Writes a portion of entity content to the underlying channel.- Specified by:
write
in 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:ContentEncoder
Terminates the content stream.- Specified by:
complete
in interfaceContentEncoder
- Throws:
java.io.IOException
- if I/O error occurs while writing content
-
abortGracefully
public boolean abortGracefully() throws java.io.IOException
- Specified by:
abortGracefully
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
java.io.IOException
-
isCompleted
public boolean isCompleted()
Description copied from interface:ContentEncoder
Returnstrue
if the entity has been transferred in its entirety.- Specified by:
isCompleted
in interfaceContentEncoder
- Returns:
true
if all the content has been produced,false
otherwise.
-
activate
public void activate() throws java.io.IOException, HttpException
- Specified by:
activate
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
java.io.IOException
HttpException
-
-