Record Class WebSocketUpgradeContext

java.lang.Object
java.lang.Record
io.micronaut.servlet.websocket.WebSocketUpgradeContext
Record Components:
webSocketBean - The @ServerWebSocket bean handling the connection
originatingRequest - The HTTP request that produced the handshake
routeMatch - The matched route
support - The shared services
jakartaEndpoint - What a @ServerEndpoint declared, or null for 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 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 bean
      originatingRequest - The handshake request
      routeMatch - The matched route
      support - 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 a WebSocketUpgradeContext record class.
      Parameters:
      webSocketBean - the value for the webSocketBean record component
      originatingRequest - the value for the originatingRequest record component
      routeMatch - the value for the routeMatch record component
      support - the value for the support record component
      jakartaEndpoint - the value for the jakartaEndpoint record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • webSocketBean

      public io.micronaut.websocket.context.WebSocketBean<Object> webSocketBean()
      Returns the value of the webSocketBean record component.
      Returns:
      the value of the webSocketBean record component
    • originatingRequest

      public io.micronaut.http.HttpRequest<?> originatingRequest()
      Returns the value of the originatingRequest record component.
      Returns:
      the value of the originatingRequest record component
    • routeMatch

      public io.micronaut.web.router.UriRouteMatch<?,?> routeMatch()
      Returns the value of the routeMatch record component.
      Returns:
      the value of the routeMatch record component
    • support

      public ServletWebSocketSupport support()
      Returns the value of the support record component.
      Returns:
      the value of the support record component
    • jakartaEndpoint

      public @Nullable JakartaEndpoint jakartaEndpoint()
      Returns the value of the jakartaEndpoint record component.
      Returns:
      the value of the jakartaEndpoint record component