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.ByteBuf
content()
FullHttpResponse
copy()
FullHttpResponse
duplicate()
boolean
equals(Object o)
int
hashCode()
int
refCnt()
boolean
release()
boolean
release(int decrement)
FullHttpResponse
replace(io.netty.buffer.ByteBuf content)
FullHttpResponse
retain()
FullHttpResponse
retain(int increment)
FullHttpResponse
retainedDuplicate()
FullHttpResponse
setProtocolVersion(HttpVersion version)
Set the protocol version of thisHttpMessage
FullHttpResponse
setStatus(HttpResponseStatus status)
Set the status of thisHttpResponse
.String
toString()
FullHttpResponse
touch()
FullHttpResponse
touch(Object hint)
HttpHeaders
trailingHeaders()
-
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:
trailingHeaders
in interfaceLastHttpContent
-
content
public io.netty.buffer.ByteBuf content()
- Specified by:
content
in interfaceio.netty.buffer.ByteBufHolder
-
refCnt
public int refCnt()
- Specified by:
refCnt
in interfaceio.netty.util.ReferenceCounted
-
retain
public FullHttpResponse retain()
- Specified by:
retain
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
retain
in interfaceFullHttpMessage
- Specified by:
retain
in interfaceFullHttpResponse
- Specified by:
retain
in interfaceHttpContent
- Specified by:
retain
in interfaceLastHttpContent
- Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
-
retain
public FullHttpResponse retain(int increment)
- Specified by:
retain
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
retain
in interfaceFullHttpMessage
- Specified by:
retain
in interfaceFullHttpResponse
- Specified by:
retain
in interfaceHttpContent
- Specified by:
retain
in interfaceLastHttpContent
- Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
-
touch
public FullHttpResponse touch()
- Specified by:
touch
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
touch
in interfaceFullHttpMessage
- Specified by:
touch
in interfaceFullHttpResponse
- Specified by:
touch
in interfaceHttpContent
- Specified by:
touch
in interfaceLastHttpContent
- Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
-
touch
public FullHttpResponse touch(Object hint)
- Specified by:
touch
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
touch
in interfaceFullHttpMessage
- Specified by:
touch
in interfaceFullHttpResponse
- Specified by:
touch
in interfaceHttpContent
- Specified by:
touch
in interfaceLastHttpContent
- Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
-
release
public boolean release()
- Specified by:
release
in interfaceio.netty.util.ReferenceCounted
-
release
public boolean release(int decrement)
- Specified by:
release
in interfaceio.netty.util.ReferenceCounted
-
setProtocolVersion
public FullHttpResponse setProtocolVersion(HttpVersion version)
Description copied from interface:HttpMessage
Set the protocol version of thisHttpMessage
- Specified by:
setProtocolVersion
in interfaceFullHttpResponse
- Specified by:
setProtocolVersion
in interfaceHttpMessage
- Specified by:
setProtocolVersion
in interfaceHttpResponse
- Overrides:
setProtocolVersion
in classDefaultHttpResponse
-
setStatus
public FullHttpResponse setStatus(HttpResponseStatus status)
Description copied from interface:HttpResponse
Set the status of thisHttpResponse
.- Specified by:
setStatus
in interfaceFullHttpResponse
- Specified by:
setStatus
in interfaceHttpResponse
- Overrides:
setStatus
in classDefaultHttpResponse
-
copy
public FullHttpResponse copy()
- Specified by:
copy
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
copy
in interfaceFullHttpMessage
- Specified by:
copy
in interfaceFullHttpResponse
- Specified by:
copy
in interfaceHttpContent
- Specified by:
copy
in interfaceLastHttpContent
-
duplicate
public FullHttpResponse duplicate()
- Specified by:
duplicate
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
duplicate
in interfaceFullHttpMessage
- Specified by:
duplicate
in interfaceFullHttpResponse
- Specified by:
duplicate
in interfaceHttpContent
- Specified by:
duplicate
in interfaceLastHttpContent
-
retainedDuplicate
public FullHttpResponse retainedDuplicate()
- Specified by:
retainedDuplicate
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
retainedDuplicate
in interfaceFullHttpMessage
- Specified by:
retainedDuplicate
in interfaceFullHttpResponse
- Specified by:
retainedDuplicate
in interfaceHttpContent
- Specified by:
retainedDuplicate
in interfaceLastHttpContent
-
replace
public FullHttpResponse replace(io.netty.buffer.ByteBuf content)
- Specified by:
replace
in interfaceio.netty.buffer.ByteBufHolder
- Specified by:
replace
in interfaceFullHttpMessage
- Specified by:
replace
in interfaceFullHttpResponse
- Specified by:
replace
in interfaceHttpContent
- Specified by:
replace
in interfaceLastHttpContent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDefaultHttpResponse
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classDefaultHttpResponse
-
toString
public String toString()
- Overrides:
toString
in classDefaultHttpResponse
-
-