Package io.netty.handler.codec.http
Class DefaultFullHttpRequest
- java.lang.Object
-
- io.netty.handler.codec.http.DefaultHttpObject
-
- io.netty.handler.codec.http.DefaultHttpMessage
-
- io.netty.handler.codec.http.DefaultHttpRequest
-
- io.netty.handler.codec.http.DefaultFullHttpRequest
-
- All Implemented Interfaces:
ByteBufHolder,DecoderResultProvider,FullHttpMessage,FullHttpRequest,HttpContent,HttpMessage,HttpObject,HttpRequest,LastHttpContent,ReferenceCounted
public class DefaultFullHttpRequest extends DefaultHttpRequest implements FullHttpRequest
Default implementation ofFullHttpRequest.
-
-
Field Summary
-
Fields inherited from interface io.netty.handler.codec.http.LastHttpContent
EMPTY_LAST_CONTENT
-
-
Constructor Summary
Constructors Constructor Description DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri)Create a full HTTP response with the given HTTP version, method, and URI.DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, boolean validateHeaders)Deprecated.Use theDefaultFullHttpRequest(HttpVersion, HttpMethod, String, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content)Create a full HTTP response with the given HTTP version, method, URI, and contents.DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content, boolean validateHeaders)Deprecated.Use theDefaultFullHttpRequest(HttpVersion, HttpMethod, String, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)Create a full HTTP response with the given HTTP version, method, URI, contents, and factories for creating headers and trailers.DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content, HttpHeaders headers, HttpHeaders trailingHeader)Create a full HTTP response with the given HTTP version, method, URI, contents, and header and trailer objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufcontent()Return the data which is held by thisByteBufHolder.FullHttpRequestcopy()Creates a deep copy of thisByteBufHolder.FullHttpRequestduplicate()Duplicates thisByteBufHolder.booleanequals(java.lang.Object o)inthashCode()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.FullHttpRequestreplace(ByteBuf content)Returns a newByteBufHolderwhich contains the specifiedcontent.FullHttpRequestretain()Increases the reference count by1.FullHttpRequestretain(int increment)Increases the reference count by the specifiedincrement.FullHttpRequestretainedDuplicate()Duplicates thisByteBufHolder.FullHttpRequestsetMethod(HttpMethod method)Set theHttpMethodof thisHttpRequest.FullHttpRequestsetProtocolVersion(HttpVersion version)Set the protocol version of thisHttpMessageFullHttpRequestsetUri(java.lang.String uri)Set the requested URI (or alternatively, path)java.lang.StringtoString()FullHttpRequesttouch()Records the current access location of this object for debugging purposes.FullHttpRequesttouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.HttpHeaderstrailingHeaders()-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpRequest
getMethod, getUri, method, uri
-
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.HttpRequest
getMethod, getUri, method, uri
-
-
-
-
Constructor Detail
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri)
Create a full HTTP response with the given HTTP version, method, and URI.
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content)
Create a full HTTP response with the given HTTP version, method, URI, and contents.
-
DefaultFullHttpRequest
@Deprecated public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, boolean validateHeaders)
Deprecated.Use theDefaultFullHttpRequest(HttpVersion, HttpMethod, String, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.Create a full HTTP response with the given HTTP version, method, URI, and optional validation.
-
DefaultFullHttpRequest
@Deprecated public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content, boolean validateHeaders)
Deprecated.Use theDefaultFullHttpRequest(HttpVersion, HttpMethod, String, ByteBuf, HttpHeadersFactory, HttpHeadersFactory)constructor instead.Create a full HTTP response with the given HTTP version, method, URI, contents, and optional validation.
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)
Create a full HTTP response with the given HTTP version, method, URI, contents, and factories for creating headers and trailers.The recommended default header factory is
DefaultHttpHeadersFactory.headersFactory(), and the recommended default trailer factory isDefaultHttpHeadersFactory.trailersFactory().
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, ByteBuf content, HttpHeaders headers, HttpHeaders trailingHeader)
Create a full HTTP response with the given HTTP version, method, URI, contents, and header and trailer objects.
-
-
Method Detail
-
trailingHeaders
public HttpHeaders trailingHeaders()
- Specified by:
trailingHeadersin interfaceLastHttpContent
-
content
public ByteBuf content()
Description copied from interface:ByteBufHolderReturn the data which is held by thisByteBufHolder.- Specified by:
contentin interfaceByteBufHolder
-
refCnt
public int refCnt()
Description copied from interface:ReferenceCountedReturns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceReferenceCounted
-
retain
public FullHttpRequest retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceFullHttpMessage- Specified by:
retainin interfaceFullHttpRequest- Specified by:
retainin interfaceHttpContent- Specified by:
retainin interfaceLastHttpContent- Specified by:
retainin interfaceReferenceCounted
-
retain
public FullHttpRequest retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceFullHttpMessage- Specified by:
retainin interfaceFullHttpRequest- Specified by:
retainin interfaceHttpContent- Specified by:
retainin interfaceLastHttpContent- Specified by:
retainin interfaceReferenceCounted
-
touch
public FullHttpRequest touch()
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceFullHttpMessage- Specified by:
touchin interfaceFullHttpRequest- Specified by:
touchin interfaceHttpContent- Specified by:
touchin interfaceLastHttpContent- Specified by:
touchin interfaceReferenceCounted
-
touch
public FullHttpRequest touch(java.lang.Object hint)
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceFullHttpMessage- Specified by:
touchin interfaceFullHttpRequest- Specified by:
touchin interfaceHttpContent- Specified by:
touchin interfaceLastHttpContent- Specified by:
touchin interfaceReferenceCounted
-
release
public boolean release()
Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement)
Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
setProtocolVersion
public FullHttpRequest setProtocolVersion(HttpVersion version)
Description copied from interface:HttpMessageSet the protocol version of thisHttpMessage- Specified by:
setProtocolVersionin interfaceFullHttpRequest- Specified by:
setProtocolVersionin interfaceHttpMessage- Specified by:
setProtocolVersionin interfaceHttpRequest- Overrides:
setProtocolVersionin classDefaultHttpRequest
-
setMethod
public FullHttpRequest setMethod(HttpMethod method)
Description copied from interface:HttpRequestSet theHttpMethodof thisHttpRequest.- Specified by:
setMethodin interfaceFullHttpRequest- Specified by:
setMethodin interfaceHttpRequest- Overrides:
setMethodin classDefaultHttpRequest
-
setUri
public FullHttpRequest setUri(java.lang.String uri)
Description copied from interface:HttpRequestSet the requested URI (or alternatively, path)- Specified by:
setUriin interfaceFullHttpRequest- Specified by:
setUriin interfaceHttpRequest- Overrides:
setUriin classDefaultHttpRequest
-
copy
public FullHttpRequest copy()
Description copied from interface:ByteBufHolderCreates a deep copy of thisByteBufHolder.- Specified by:
copyin interfaceByteBufHolder- Specified by:
copyin interfaceFullHttpMessage- Specified by:
copyin interfaceFullHttpRequest- Specified by:
copyin interfaceHttpContent- Specified by:
copyin interfaceLastHttpContent
-
duplicate
public FullHttpRequest duplicate()
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. Be aware that this will not automatically callByteBufHolder.retain().- Specified by:
duplicatein interfaceByteBufHolder- Specified by:
duplicatein interfaceFullHttpMessage- Specified by:
duplicatein interfaceFullHttpRequest- Specified by:
duplicatein interfaceHttpContent- Specified by:
duplicatein interfaceLastHttpContent
-
retainedDuplicate
public FullHttpRequest retainedDuplicate()
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. This method returns a retained duplicate unlikeByteBufHolder.duplicate().- Specified by:
retainedDuplicatein interfaceByteBufHolder- Specified by:
retainedDuplicatein interfaceFullHttpMessage- Specified by:
retainedDuplicatein interfaceFullHttpRequest- Specified by:
retainedDuplicatein interfaceHttpContent- Specified by:
retainedDuplicatein interfaceLastHttpContent- See Also:
ByteBuf.retainedDuplicate()
-
replace
public FullHttpRequest replace(ByteBuf content)
Description copied from interface:ByteBufHolderReturns a newByteBufHolderwhich contains the specifiedcontent.- Specified by:
replacein interfaceByteBufHolder- Specified by:
replacein interfaceFullHttpMessage- Specified by:
replacein interfaceFullHttpRequest- Specified by:
replacein interfaceHttpContent- Specified by:
replacein interfaceLastHttpContent
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultHttpRequest
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classDefaultHttpRequest
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDefaultHttpRequest
-
-