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
Default implementation of a
FullHttpResponse.-
Field Summary
Fields inherited from interface io.netty.handler.codec.http.LastHttpContent
EMPTY_LAST_CONTENT -
Constructor Summary
ConstructorsConstructorDescriptionDefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status) Create an empty HTTP response with the given HTTP version and status.DefaultFullHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders) Deprecated.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
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBufcontent()copy()booleaninthashCode()intrefCnt()booleanrelease()booleanrelease(int decrement) replace(io.netty.buffer.ByteBuf content) retain()retain(int increment) setProtocolVersion(HttpVersion version) Set the protocol version of thisHttpMessagesetStatus(HttpResponseStatus status) Set the status of thisHttpResponse.toString()touch()Methods inherited from class io.netty.handler.codec.http.DefaultHttpResponse
getStatus, statusMethods inherited from class io.netty.handler.codec.http.DefaultHttpMessage
getProtocolVersion, headers, protocolVersionMethods inherited from class io.netty.handler.codec.http.DefaultHttpObject
decoderResult, getDecoderResult, setDecoderResultMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResultMethods inherited from interface io.netty.handler.codec.http.HttpMessage
getProtocolVersion, headers, protocolVersionMethods inherited from interface io.netty.handler.codec.http.HttpObject
getDecoderResultMethods inherited from interface io.netty.handler.codec.http.HttpResponse
getStatus, status
-
Constructor Details
-
DefaultFullHttpResponse
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 Details
-
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
- 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
- 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
- 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
- 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
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
Description copied from interface:HttpResponseSet the status of thisHttpResponse.- Specified by:
setStatusin interfaceFullHttpResponse- Specified by:
setStatusin interfaceHttpResponse- Overrides:
setStatusin classDefaultHttpResponse
-
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
- Specified by:
duplicatein interfaceio.netty.buffer.ByteBufHolder- Specified by:
duplicatein interfaceFullHttpMessage- Specified by:
duplicatein interfaceFullHttpResponse- Specified by:
duplicatein interfaceHttpContent- Specified by:
duplicatein interfaceLastHttpContent
-
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
- 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
- Overrides:
equalsin classDefaultHttpResponse
-
toString
- Overrides:
toStringin classDefaultHttpResponse
-
DefaultFullHttpResponse(HttpVersion, HttpResponseStatus, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.