- java.lang.Object
-
- io.netty5.handler.codec.http.DefaultHttpObject
-
- io.netty5.handler.codec.http.DefaultHttpMessage
-
- io.netty5.handler.codec.http.DefaultHttpRequest
-
- io.netty5.handler.codec.http.DefaultFullHttpRequest
-
- All Implemented Interfaces:
DecoderResultProvider,FullHttpMessage<FullHttpRequest>,FullHttpRequest,HttpContent<FullHttpRequest>,HttpMessage,HttpObject,HttpRequest,LastHttpContent<FullHttpRequest>,Resource<FullHttpRequest>,AutoCloseable
public class DefaultFullHttpRequest extends DefaultHttpRequest implements FullHttpRequest
Default implementation ofFullHttpRequest.
-
-
Constructor Summary
Constructors Constructor Description DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, Buffer payload)DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, Buffer payload, boolean validateHeaders)DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, Buffer payload, HttpHeaders headers, HttpHeaders trailingHeader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the resource, making it inaccessible.FullHttpRequestcopy()Create a copy of this HTTP content instance, and return it.booleanequals(Object o)inthashCode()booleanisAccessible()Check if this object is accessible.Bufferpayload()Returns theBufferrepresenting the payload of the HTTP message.Send<FullHttpRequest>send()Send this object instance to another Thread, transferring the ownership to the recipient.FullHttpRequestsetMethod(HttpMethod method)Set theHttpMethodof thisHttpRequest.FullHttpRequestsetProtocolVersion(HttpVersion version)Set the protocol version of thisHttpMessageFullHttpRequestsetUri(String uri)Set the requested URI (or alternatively, path)StringtoString()FullHttpRequesttouch(Object hint)Record the current access location for debugging purposes.HttpHeaderstrailingHeaders()-
Methods inherited from class io.netty5.handler.codec.http.DefaultHttpRequest
method, uri
-
Methods inherited from class io.netty5.handler.codec.http.DefaultHttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from class io.netty5.handler.codec.http.DefaultHttpObject
decoderResult, setDecoderResult
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
-
Methods inherited from interface io.netty5.handler.codec.http.HttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from interface io.netty5.handler.codec.http.HttpRequest
method, uri
-
-
-
-
Constructor Detail
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, Buffer payload)
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, Buffer payload, boolean validateHeaders)
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, Buffer payload, HttpHeaders headers, HttpHeaders trailingHeader)
-
-
Method Detail
-
close
public void close()
Description copied from interface:ResourceClose the resource, making it inaccessible.Note, this method is not thread-safe unless otherwise specified.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResource<FullHttpRequest>
-
isAccessible
public boolean isAccessible()
Description copied from interface:ResourceCheck if this object is accessible.- Specified by:
isAccessiblein interfaceResource<FullHttpRequest>- Returns:
trueif this object is still valid and can be accessed, otherwisefalseif, for instance, this object has been dropped/deallocated, or been sent elsewhere.
-
touch
public FullHttpRequest touch(Object hint)
Description copied from interface:ResourceRecord the current access location for debugging purposes. This information may be included if the resource throws a life-cycle related exception, or if it leaks. If this resource has already been closed, then this method has no effect.- Specified by:
touchin interfaceResource<FullHttpRequest>- Parameters:
hint- An optional hint about this access and its context. May benull.- Returns:
- This resource instance.
-
payload
public Buffer payload()
Description copied from interface:HttpContentReturns theBufferrepresenting the payload of the HTTP message.- Specified by:
payloadin interfaceHttpContent<FullHttpRequest>- Returns:
- The
Bufferrepresenting the payload of the HTTP message.
-
send
public Send<FullHttpRequest> send()
Description copied from interface:ResourceSend this object instance to another Thread, transferring the ownership to the recipient.The object must be in a state where it can be sent, which includes at least being accessible.
When sent, this instance will immediately become inaccessible, as if by closing it. All attempts at accessing an object that has been sent, even if that object has not yet been received, should cause an exception to be thrown.
Calling
Resource.close()on an object that has been sent will have no effect, so this method is safe to call within a try-with-resources statement.- Specified by:
sendin interfaceResource<FullHttpRequest>
-
copy
public FullHttpRequest copy()
Description copied from interface:HttpContentCreate a copy of this HTTP content instance, and return it.- Specified by:
copyin interfaceHttpContent<FullHttpRequest>- Returns:
- A copy of this HTTP content object.
-
trailingHeaders
public HttpHeaders trailingHeaders()
- Specified by:
trailingHeadersin interfaceLastHttpContent<FullHttpRequest>
-
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(String uri)
Description copied from interface:HttpRequestSet the requested URI (or alternatively, path)- Specified by:
setUriin interfaceFullHttpRequest- Specified by:
setUriin interfaceHttpRequest- Overrides:
setUriin classDefaultHttpRequest
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultHttpRequest
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classDefaultHttpRequest
-
toString
public String toString()
- Overrides:
toStringin classDefaultHttpRequest
-
-