Package io.netty.handler.codec.http
Class DefaultFullHttpResponse
- java.lang.Object
-
- io.netty.handler.codec.http.DefaultHttpObject
-
- io.netty.handler.codec.http.DefaultHttpMessage
-
- io.netty.handler.codec.http.DefaultHttpResponse
-
- io.netty.handler.codec.http.DefaultFullHttpResponse
-
- All Implemented Interfaces:
io.netty.buffer.ByteBufHolder,io.netty.handler.codec.DecoderResultProvider,FullHttpMessage,FullHttpResponse,HttpContent,HttpMessage,HttpObject,HttpResponse,LastHttpContent,io.netty.util.ReferenceCounted
public class DefaultFullHttpResponse extends DefaultHttpResponse implements FullHttpResponse
Default implementation of aFullHttpResponse.
-
-
Field Summary
-
Fields inherited from interface io.netty.handler.codec.http.LastHttpContent
EMPTY_LAST_CONTENT
-
-
Constructor Summary
Constructors Constructor Description DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status)Create an empty HTTP response with the given HTTP version and status.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders)Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders)Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content)Create an HTTP response with the given HTTP version, status, and contents.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, boolean validateHeaders)Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, boolean validateHeaders, boolean singleFieldHeaders)Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)Create an HTTP response with the given HTTP version, status, contents, and with headers and trailers created by the given header factories.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, HttpHeaders headers, HttpHeaders trailingHeaders)Create an HTTP response with the given HTTP version, status, contents, headers and trailers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufcontent()FullHttpResponsecopy()FullHttpResponseduplicate()booleanequals(Object o)inthashCode()intrefCnt()booleanrelease()booleanrelease(int decrement)FullHttpResponsereplace(io.netty.buffer.ByteBuf content)FullHttpResponseretain()FullHttpResponseretain(int increment)FullHttpResponseretainedDuplicate()FullHttpResponsesetProtocolVersion(HttpVersion version)Set the protocol version of thisHttpMessageFullHttpResponsesetStatus(HttpResponseStatus status)Set the status of thisHttpResponse.StringtoString()FullHttpResponsetouch()FullHttpResponsetouch(Object hint)HttpHeaderstrailingHeaders()-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpResponse
getStatus, status
-
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
-
Methods inherited from interface io.netty.handler.codec.http.HttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from interface io.netty.handler.codec.http.HttpObject
getDecoderResult
-
Methods inherited from interface io.netty.handler.codec.http.HttpResponse
getStatus, status
-
-
-
-
Constructor Detail
-
DefaultFullHttpResponse
public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status)
Create an empty HTTP response with the given HTTP version and status.
-
DefaultFullHttpResponse
public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content)
Create an HTTP response with the given HTTP version, status, and contents.
-
DefaultFullHttpResponse
@Deprecated public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders)
Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.Create an empty HTTP response with the given HTTP version, status, and optional header validation.
-
DefaultFullHttpResponse
@Deprecated public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders)
Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.Create an empty HTTP response with the given HTTP version, status, optional header validation, and optional header combining.
-
DefaultFullHttpResponse
@Deprecated public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, boolean validateHeaders)
Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.Create an HTTP response with the given HTTP version, status, contents, and optional header validation.
-
DefaultFullHttpResponse
@Deprecated public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, boolean validateHeaders, boolean singleFieldHeaders)
Deprecated.Prefer theDefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.Create an HTTP response with the given HTTP version, status, contents, optional header validation, and optional header combining.
-
DefaultFullHttpResponse
public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)
Create an HTTP response with the given HTTP version, status, contents, and with headers and trailers created by the given header factories.The recommended header factory is
DefaultHttpHeadersFactory.headersFactory(), and the recommended trailer factory isDefaultHttpHeadersFactory.trailersFactory().
-
DefaultFullHttpResponse
public DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, io.netty.buffer.ByteBuf content, HttpHeaders headers, HttpHeaders trailingHeaders)
Create an HTTP response with the given HTTP version, status, contents, headers and trailers.
-
-
Method Detail
-
trailingHeaders
public HttpHeaders trailingHeaders()
- Specified by:
trailingHeadersin interfaceLastHttpContent
-
content
public io.netty.buffer.ByteBuf content()
- Specified by:
contentin interfaceio.netty.buffer.ByteBufHolder
-
refCnt
public int refCnt()
- Specified by:
refCntin interfaceio.netty.util.ReferenceCounted
-
retain
public FullHttpResponse retain()
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceFullHttpMessage- Specified by:
retainin interfaceFullHttpResponse- Specified by:
retainin interfaceHttpContent- Specified by:
retainin interfaceLastHttpContent- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
retain
public FullHttpResponse retain(int increment)
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceFullHttpMessage- Specified by:
retainin interfaceFullHttpResponse- Specified by:
retainin interfaceHttpContent- Specified by:
retainin interfaceLastHttpContent- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
touch
public FullHttpResponse touch()
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceFullHttpMessage- Specified by:
touchin interfaceFullHttpResponse- Specified by:
touchin interfaceHttpContent- Specified by:
touchin interfaceLastHttpContent- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
touch
public FullHttpResponse touch(Object hint)
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceFullHttpMessage- Specified by:
touchin interfaceFullHttpResponse- Specified by:
touchin interfaceHttpContent- Specified by:
touchin interfaceLastHttpContent- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
release
public boolean release()
- Specified by:
releasein interfaceio.netty.util.ReferenceCounted
-
release
public boolean release(int decrement)
- Specified by:
releasein interfaceio.netty.util.ReferenceCounted
-
setProtocolVersion
public FullHttpResponse setProtocolVersion(HttpVersion version)
Description copied from interface:HttpMessageSet the protocol version of thisHttpMessage- Specified by:
setProtocolVersionin interfaceFullHttpResponse- Specified by:
setProtocolVersionin interfaceHttpMessage- Specified by:
setProtocolVersionin interfaceHttpResponse- Overrides:
setProtocolVersionin classDefaultHttpResponse
-
setStatus
public FullHttpResponse setStatus(HttpResponseStatus status)
Description copied from interface:HttpResponseSet the status of thisHttpResponse.- Specified by:
setStatusin interfaceFullHttpResponse- Specified by:
setStatusin interfaceHttpResponse- Overrides:
setStatusin classDefaultHttpResponse
-
copy
public FullHttpResponse copy()
- Specified by:
copyin interfaceio.netty.buffer.ByteBufHolder- Specified by:
copyin interfaceFullHttpMessage- Specified by:
copyin interfaceFullHttpResponse- Specified by:
copyin interfaceHttpContent- Specified by:
copyin interfaceLastHttpContent
-
duplicate
public FullHttpResponse duplicate()
- Specified by:
duplicatein interfaceio.netty.buffer.ByteBufHolder- Specified by:
duplicatein interfaceFullHttpMessage- Specified by:
duplicatein interfaceFullHttpResponse- Specified by:
duplicatein interfaceHttpContent- Specified by:
duplicatein interfaceLastHttpContent
-
retainedDuplicate
public FullHttpResponse retainedDuplicate()
- Specified by:
retainedDuplicatein interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainedDuplicatein interfaceFullHttpMessage- Specified by:
retainedDuplicatein interfaceFullHttpResponse- Specified by:
retainedDuplicatein interfaceHttpContent- Specified by:
retainedDuplicatein interfaceLastHttpContent
-
replace
public FullHttpResponse replace(io.netty.buffer.ByteBuf content)
- Specified by:
replacein interfaceio.netty.buffer.ByteBufHolder- Specified by:
replacein interfaceFullHttpMessage- Specified by:
replacein interfaceFullHttpResponse- Specified by:
replacein interfaceHttpContent- Specified by:
replacein interfaceLastHttpContent
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultHttpResponse
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classDefaultHttpResponse
-
toString
public String toString()
- Overrides:
toStringin classDefaultHttpResponse
-
-