Package com.linkedin.alpini.netty4.misc
Class DefaultFileChannelHttpResponse
- java.lang.Object
-
- io.netty.handler.codec.http.DefaultHttpObject
-
- io.netty.handler.codec.http.DefaultHttpMessage
-
- io.netty.handler.codec.http.DefaultHttpResponse
-
- com.linkedin.alpini.netty4.misc.DefaultFileChannelHttpResponse
-
- All Implemented Interfaces:
ChunkedHttpResponse,io.netty.buffer.ByteBufHolder,io.netty.handler.codec.DecoderResultProvider,io.netty.handler.codec.http.FullHttpMessage,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpContent,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpResponse,io.netty.handler.codec.http.LastHttpContent,io.netty.util.ReferenceCounted
public class DefaultFileChannelHttpResponse extends io.netty.handler.codec.http.DefaultHttpResponse implements ChunkedHttpResponse
-
-
Constructor Summary
Constructors Constructor Description DefaultFileChannelHttpResponse(io.netty.handler.codec.http.HttpVersion version, io.netty.handler.codec.http.HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders, io.netty.buffer.ByteBufAllocator alloc, java.nio.channels.FileChannel fileChannel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufcontent()io.netty.handler.codec.http.FullHttpResponsecopy()io.netty.handler.codec.http.FullHttpResponseduplicate()intrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement)Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.io.netty.handler.codec.http.FullHttpResponsereplace(io.netty.buffer.ByteBuf content)io.netty.handler.codec.http.FullHttpResponseretain()io.netty.handler.codec.http.FullHttpResponseretain(int increment)io.netty.handler.codec.http.FullHttpResponseretainedDuplicate()io.netty.handler.codec.http.FullHttpResponsesetProtocolVersion(io.netty.handler.codec.http.HttpVersion version)io.netty.handler.codec.http.FullHttpResponsesetStatus(io.netty.handler.codec.http.HttpResponseStatus status)io.netty.handler.codec.http.FullHttpResponsetouch()io.netty.handler.codec.http.FullHttpResponsetouch(java.lang.Object hint)io.netty.handler.codec.http.HttpHeaderstrailingHeaders()voidwriteChunkedContent(io.netty.channel.ChannelHandlerContext ctx, io.netty.util.concurrent.Promise<io.netty.handler.codec.http.LastHttpContent> writePromise)-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpResponse
equals, getStatus, hashCode, status, toString
-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpObject
decoderResult, getDecoderResult, setDecoderResult
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
-
-
-
-
Constructor Detail
-
DefaultFileChannelHttpResponse
public DefaultFileChannelHttpResponse(@Nonnull io.netty.handler.codec.http.HttpVersion version, @Nonnull io.netty.handler.codec.http.HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders, @Nonnull io.netty.buffer.ByteBufAllocator alloc, @Nonnull java.nio.channels.FileChannel fileChannel)
-
-
Method Detail
-
writeChunkedContent
public void writeChunkedContent(io.netty.channel.ChannelHandlerContext ctx, io.netty.util.concurrent.Promise<io.netty.handler.codec.http.LastHttpContent> writePromise) throws java.io.IOException- Specified by:
writeChunkedContentin interfaceChunkedHttpResponse- Throws:
java.io.IOException
-
trailingHeaders
public io.netty.handler.codec.http.HttpHeaders trailingHeaders()
- Specified by:
trailingHeadersin interfaceio.netty.handler.codec.http.LastHttpContent
-
content
public io.netty.buffer.ByteBuf content()
- Specified by:
contentin interfaceio.netty.buffer.ByteBufHolder
-
copy
public io.netty.handler.codec.http.FullHttpResponse copy()
- Specified by:
copyin interfaceio.netty.buffer.ByteBufHolder- Specified by:
copyin interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
copyin interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
copyin interfaceio.netty.handler.codec.http.HttpContent- Specified by:
copyin interfaceio.netty.handler.codec.http.LastHttpContent
-
duplicate
public io.netty.handler.codec.http.FullHttpResponse duplicate()
- Specified by:
duplicatein interfaceio.netty.buffer.ByteBufHolder- Specified by:
duplicatein interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
duplicatein interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
duplicatein interfaceio.netty.handler.codec.http.HttpContent- Specified by:
duplicatein interfaceio.netty.handler.codec.http.LastHttpContent
-
retainedDuplicate
public io.netty.handler.codec.http.FullHttpResponse retainedDuplicate()
- Specified by:
retainedDuplicatein interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainedDuplicatein interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
retainedDuplicatein interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
retainedDuplicatein interfaceio.netty.handler.codec.http.HttpContent- Specified by:
retainedDuplicatein interfaceio.netty.handler.codec.http.LastHttpContent
-
replace
public io.netty.handler.codec.http.FullHttpResponse replace(io.netty.buffer.ByteBuf content)
- Specified by:
replacein interfaceio.netty.buffer.ByteBufHolder- Specified by:
replacein interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
replacein interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
replacein interfaceio.netty.handler.codec.http.HttpContent- Specified by:
replacein interfaceio.netty.handler.codec.http.LastHttpContent
-
retain
public io.netty.handler.codec.http.FullHttpResponse retain(int increment)
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
retainin interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
retainin interfaceio.netty.handler.codec.http.HttpContent- Specified by:
retainin interfaceio.netty.handler.codec.http.LastHttpContent- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
refCnt
public int refCnt()
Returns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceio.netty.util.ReferenceCounted
-
retain
public io.netty.handler.codec.http.FullHttpResponse retain()
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
retainin interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
retainin interfaceio.netty.handler.codec.http.HttpContent- Specified by:
retainin interfaceio.netty.handler.codec.http.LastHttpContent- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
touch
public io.netty.handler.codec.http.FullHttpResponse touch()
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
touchin interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
touchin interfaceio.netty.handler.codec.http.HttpContent- Specified by:
touchin interfaceio.netty.handler.codec.http.LastHttpContent- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
touch
public io.netty.handler.codec.http.FullHttpResponse touch(java.lang.Object hint)
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceio.netty.handler.codec.http.FullHttpMessage- Specified by:
touchin interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
touchin interfaceio.netty.handler.codec.http.HttpContent- Specified by:
touchin interfaceio.netty.handler.codec.http.LastHttpContent- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
release
public boolean release()
Decreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceio.netty.util.ReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement)
Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceio.netty.util.ReferenceCounted- Parameters:
decrement-- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
setStatus
public io.netty.handler.codec.http.FullHttpResponse setStatus(io.netty.handler.codec.http.HttpResponseStatus status)
- Specified by:
setStatusin interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
setStatusin interfaceio.netty.handler.codec.http.HttpResponse- Overrides:
setStatusin classio.netty.handler.codec.http.DefaultHttpResponse
-
setProtocolVersion
public io.netty.handler.codec.http.FullHttpResponse setProtocolVersion(io.netty.handler.codec.http.HttpVersion version)
- Specified by:
setProtocolVersionin interfaceio.netty.handler.codec.http.FullHttpResponse- Specified by:
setProtocolVersionin interfaceio.netty.handler.codec.http.HttpMessage- Specified by:
setProtocolVersionin interfaceio.netty.handler.codec.http.HttpResponse- Overrides:
setProtocolVersionin classio.netty.handler.codec.http.DefaultHttpResponse
-
-