Representa una sesión WebSocket activa. More...
Public Member Functions | |
| Object | attribute (String name) |
| Devuelve un atributo almacenado en esta sesión bajo el nombre dado. | |
| void | attribute (String name, Object value) |
| Almacena un atributo en esta sesión bajo el nombre dado. | |
| CompletionStage< Void > | close (WebSocketCloseStatus status) |
| Cierra la conexión WebSocket con el estado de cierre especificado. | |
| String | headerFirst (String name) |
| Devuelve el primer valor del header HTTP con el nombre especificado. | |
| Map< String, List< String > > | headers () |
| Devuelve todos los headers HTTP de la petición de handshake. | |
| String | id () |
| Devuelve el identificador único de esta sesión. | |
| boolean | isOpen () |
| Indica si la conexión WebSocket sigue abierta. | |
| String | path () |
| Devuelve el path de la petición WebSocket que originó esta sesión. | |
| String | pathParam (String name) |
| Devuelve el valor del parámetro de path con el nombre especificado. | |
| Map< String, String > | pathParams () |
| Devuelve todos los parámetros de path extraídos durante el matching de ruta. | |
| List< String > | queryAll (String name) |
| Devuelve todos los valores del parámetro de query con el nombre especificado. | |
| String | queryFirst (String name) |
| Devuelve el primer valor del parámetro de query con el nombre especificado. | |
| Map< String, List< String > > | queryParams () |
| Devuelve todos los parámetros de query de la URI de la conexión. | |
| CompletionStage< Void > | sendBinary (ByteBuffer data) |
| Envía un mensaje binario al cliente conectado. | |
| CompletionStage< Void > | sendText (String text) |
| Envía un mensaje de texto al cliente conectado. | |
| String | subprotocol () |
| Devuelve el subprotocolo WebSocket negociado durante el handshake. | |
Representa una sesión WebSocket activa.
Proporciona acceso a los metadatos de la conexión (identificador, path, headers, parámetros) y métodos para enviar mensajes y cerrar la sesión.
Definition at line 38 of file WebSocketSession.java.
| Object dev.rafex.ether.websocket.core.WebSocketSession.attribute | ( | String | name | ) |
Devuelve un atributo almacenado en esta sesión bajo el nombre dado.
| name | clave del atributo |
null si no existe Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| void dev.rafex.ether.websocket.core.WebSocketSession.attribute | ( | String | name, |
| Object | value ) |
Almacena un atributo en esta sesión bajo el nombre dado.
| name | clave del atributo |
| value | valor a almacenar |
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| CompletionStage< Void > dev.rafex.ether.websocket.core.WebSocketSession.close | ( | WebSocketCloseStatus | status | ) |
Cierra la conexión WebSocket con el estado de cierre especificado.
| status | estado de cierre a enviar al cliente |
CompletionStage que se completa cuando la conexión se cierra Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
References dev.rafex.ether.websocket.core.WebSocketCloseStatus().
| String dev.rafex.ether.websocket.core.WebSocketSession.headerFirst | ( | String | name | ) |
Devuelve el primer valor del header HTTP con el nombre especificado.
| name | nombre del header (case-insensitive) |
null si no existe Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| Map< String, List< String > > dev.rafex.ether.websocket.core.WebSocketSession.headers | ( | ) |
Devuelve todos los headers HTTP de la petición de handshake.
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| String dev.rafex.ether.websocket.core.WebSocketSession.id | ( | ) |
Devuelve el identificador único de esta sesión.
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| boolean dev.rafex.ether.websocket.core.WebSocketSession.isOpen | ( | ) |
Indica si la conexión WebSocket sigue abierta.
true si la sesión está activa; false si ya se cerró Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| String dev.rafex.ether.websocket.core.WebSocketSession.path | ( | ) |
Devuelve el path de la petición WebSocket que originó esta sesión.
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| String dev.rafex.ether.websocket.core.WebSocketSession.pathParam | ( | String | name | ) |
Devuelve el valor del parámetro de path con el nombre especificado.
| name | nombre del parámetro de path |
null si no existe Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| Map< String, String > dev.rafex.ether.websocket.core.WebSocketSession.pathParams | ( | ) |
Devuelve todos los parámetros de path extraídos durante el matching de ruta.
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| List< String > dev.rafex.ether.websocket.core.WebSocketSession.queryAll | ( | String | name | ) |
Devuelve todos los valores del parámetro de query con el nombre especificado.
| name | nombre del parámetro de query |
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| String dev.rafex.ether.websocket.core.WebSocketSession.queryFirst | ( | String | name | ) |
Devuelve el primer valor del parámetro de query con el nombre especificado.
| name | nombre del parámetro de query |
null si no existe Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| Map< String, List< String > > dev.rafex.ether.websocket.core.WebSocketSession.queryParams | ( | ) |
Devuelve todos los parámetros de query de la URI de la conexión.
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| CompletionStage< Void > dev.rafex.ether.websocket.core.WebSocketSession.sendBinary | ( | ByteBuffer | data | ) |
Envía un mensaje binario al cliente conectado.
| data | contenido binario a enviar |
CompletionStage que se completa cuando el mensaje se envía Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| CompletionStage< Void > dev.rafex.ether.websocket.core.WebSocketSession.sendText | ( | String | text | ) |
Envía un mensaje de texto al cliente conectado.
| text | contenido de texto a enviar |
CompletionStage que se completa cuando el mensaje se envía Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.
| String dev.rafex.ether.websocket.core.WebSocketSession.subprotocol | ( | ) |
Devuelve el subprotocolo WebSocket negociado durante el handshake.
Implemented in dev.rafex.ether.websocket.jetty12.JettyWebSocketSession.