Module io.netty5.codec.http
Package io.netty5.handler.codec.http
Class HttpServerUpgradeHandler.UpgradeEvent
- java.lang.Object
-
- io.netty5.handler.codec.http.HttpServerUpgradeHandler.UpgradeEvent
-
- All Implemented Interfaces:
Resource<HttpServerUpgradeHandler.UpgradeEvent>
,AutoCloseable
- Enclosing class:
- HttpServerUpgradeHandler<C extends HttpContent<C>>
public static final class HttpServerUpgradeHandler.UpgradeEvent extends Object implements Resource<HttpServerUpgradeHandler.UpgradeEvent>
User event that is fired to notify about the completion of an HTTP upgrade to another protocol. Contains the original upgrade request so that the response (if required) can be sent using the new protocol.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the resource, making it inaccessible.HttpServerUpgradeHandler.UpgradeEvent
copy()
boolean
isAccessible()
Check if this object is accessible.CharSequence
protocol()
The protocol that the channel has been upgraded to.Send<HttpServerUpgradeHandler.UpgradeEvent>
send()
Send this object instance to another Thread, transferring the ownership to the recipient.String
toString()
HttpServerUpgradeHandler.UpgradeEvent
touch(Object hint)
Record the current access location for debugging purposes.FullHttpRequest
upgradeRequest()
Gets the request that triggered the protocol upgrade.
-
-
-
Method Detail
-
protocol
public CharSequence protocol()
The protocol that the channel has been upgraded to.
-
upgradeRequest
public FullHttpRequest upgradeRequest()
Gets the request that triggered the protocol upgrade.
-
send
public Send<HttpServerUpgradeHandler.UpgradeEvent> send()
Description copied from interface:Resource
Send 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:
send
in interfaceResource<HttpServerUpgradeHandler.UpgradeEvent>
-
copy
public HttpServerUpgradeHandler.UpgradeEvent copy()
-
close
public void close()
Description copied from interface:Resource
Close the resource, making it inaccessible.Note, this method is not thread-safe unless otherwise specified.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceResource<HttpServerUpgradeHandler.UpgradeEvent>
-
isAccessible
public boolean isAccessible()
Description copied from interface:Resource
Check if this object is accessible.- Specified by:
isAccessible
in interfaceResource<HttpServerUpgradeHandler.UpgradeEvent>
- Returns:
true
if this object is still valid and can be accessed, otherwisefalse
if, for instance, this object has been dropped/deallocated, or been sent elsewhere.
-
touch
public HttpServerUpgradeHandler.UpgradeEvent touch(Object hint)
Description copied from interface:Resource
Record 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:
touch
in interfaceResource<HttpServerUpgradeHandler.UpgradeEvent>
- Parameters:
hint
- An optional hint about this access and its context. May benull
.- Returns:
- This resource instance.
-
-