Record Class WebSocketUpgradeContext
java.lang.Object
java.lang.Record
io.micronaut.servlet.websocket.WebSocketUpgradeContext
- Record Components:
webSocketBean- The@ServerWebSocketbean handling the connectionoriginatingRequest- The HTTP request that produced the handshakerouteMatch- The matched routesupport- The shared servicesjakartaEndpoint- What a@ServerEndpointdeclared, ornullfor a Micronaut endpoint
@Internal
public record WebSocketUpgradeContext(io.micronaut.websocket.context.WebSocketBean<Object> webSocketBean, io.micronaut.http.HttpRequest<?> originatingRequest, io.micronaut.web.router.UriRouteMatch<?,?> routeMatch, ServletWebSocketSupport support, @Nullable JakartaEndpoint jakartaEndpoint)
extends Record
The per-upgrade state a
MicronautServerEndpoint needs, passed to the endpoint
through the user properties of the ServerEndpointConfig created for the upgrade.- Since:
- 6.2.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorsConstructorDescriptionWebSocketUpgradeContext(io.micronaut.websocket.context.WebSocketBean<Object> webSocketBean, io.micronaut.http.HttpRequest<?> originatingRequest, io.micronaut.web.router.UriRouteMatch<?, ?> routeMatch, ServletWebSocketSupport support) Constructor for a Micronaut@ServerWebSocket.WebSocketUpgradeContext(io.micronaut.websocket.context.WebSocketBean<Object> webSocketBean, io.micronaut.http.HttpRequest<?> originatingRequest, io.micronaut.web.router.UriRouteMatch<?, ?> routeMatch, ServletWebSocketSupport support, @Nullable JakartaEndpoint jakartaEndpoint) Creates an instance of aWebSocketUpgradeContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable JakartaEndpointReturns the value of thejakartaEndpointrecord component.io.micronaut.http.HttpRequest<?> Returns the value of theoriginatingRequestrecord component.io.micronaut.web.router.UriRouteMatch<?, ?> Returns the value of therouteMatchrecord component.support()Returns the value of thesupportrecord component.final StringtoString()Returns a string representation of this record class.io.micronaut.websocket.context.WebSocketBean<Object> Returns the value of thewebSocketBeanrecord component.
-
Constructor Details
-
WebSocketUpgradeContext
public WebSocketUpgradeContext(io.micronaut.websocket.context.WebSocketBean<Object> webSocketBean, io.micronaut.http.HttpRequest<?> originatingRequest, io.micronaut.web.router.UriRouteMatch<?, ?> routeMatch, ServletWebSocketSupport support) Constructor for a Micronaut@ServerWebSocket.- Parameters:
webSocketBean- The WebSocket beanoriginatingRequest- The handshake requestrouteMatch- The matched routesupport- The shared services
-
WebSocketUpgradeContext
public WebSocketUpgradeContext(io.micronaut.websocket.context.WebSocketBean<Object> webSocketBean, io.micronaut.http.HttpRequest<?> originatingRequest, io.micronaut.web.router.UriRouteMatch<?, ?> routeMatch, ServletWebSocketSupport support, @Nullable JakartaEndpoint jakartaEndpoint) Creates an instance of aWebSocketUpgradeContextrecord class.- Parameters:
webSocketBean- the value for thewebSocketBeanrecord componentoriginatingRequest- the value for theoriginatingRequestrecord componentrouteMatch- the value for therouteMatchrecord componentsupport- the value for thesupportrecord componentjakartaEndpoint- the value for thejakartaEndpointrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
webSocketBean
Returns the value of thewebSocketBeanrecord component.- Returns:
- the value of the
webSocketBeanrecord component
-
originatingRequest
public io.micronaut.http.HttpRequest<?> originatingRequest()Returns the value of theoriginatingRequestrecord component.- Returns:
- the value of the
originatingRequestrecord component
-
routeMatch
public io.micronaut.web.router.UriRouteMatch<?,?> routeMatch()Returns the value of therouteMatchrecord component.- Returns:
- the value of the
routeMatchrecord component
-
support
-
jakartaEndpoint
Returns the value of thejakartaEndpointrecord component.- Returns:
- the value of the
jakartaEndpointrecord component
-